summaryrefslogtreecommitdiff
path: root/src/HttpConnection.cc
Commit message (Collapse)AuthorAgeFilesLines
* To add TrackerUpdateCommand with which replacesTatsuhiro Tsujikawa2006-04-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CompactTrackerResponseProcessor: * src/TrackerWatcherCommand.h (req): Removed. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker if the number of peer connections are less than 30. * src/ByteArrayDiskWriter.h (readData): Implemented. * src/SegmentMan.h (diskWriter): New function. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile() * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h" (main): Use TrackerUpdateCommand. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed. (req): New variable. (setTrackerResponseProcessor): Removed. (getTrackerResponseProcessor): Removed. (processTrackerResponse): Removed. * src/DownloadEngine.h (diskWriter): Removed. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call to torrentMan->processTrackerResponse(). To add Util::expandBuffer: * src/ByteArrayDiskWriter.h (expandBuffer): Removed. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer(). * src/Util.h (expandBuffer): New function. To fix the bug that causes segmentation fault when "-l ." is specified in command-line option: * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument. (openFile): New function. (closeFile): New function. * src/SimpleLogger.cc (SimpleLogger): Removed fopen. (~SimpleLogger): Call closeFile(); * src/LogFactory.cc (getInstance): Added a call to slogger->openFile(). * src/main.cc (main): Added a check to see logger is configured properly. To enable HTTP authentication without specifying "--http-auth-scheme" * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition. * src/HttpConnection.cc (createRequest): Send Authorization header if PREF_HTTP_AUTH_ENABLED == V_TRUE. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE * src/Peer.cc (shouldChoke): Updated algorithm. * src/message.h (EX_AUTH_FAILED): New definition. (EX_FILE_OPEN): New definition. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx if status == 401. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile() if req->isTorrent == true. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL (torrentHandler): Removed the check to see diskAdaptor != NULL. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage. (createFile): Updated message.
* To add LogFactory which creates singleton logger:Tatsuhiro Tsujikawa2006-04-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/LogFactory.h: New class. * src/LogFactory.cc: New class. * src/Command.h (logger): New variable. (Constructor): Use LogFactory. * src/AbstractCommand.cc: Use Command::logger * src/PeerConnection.cc (Constructor): Deleted the argument logger. Use LogFactory. * src/SegmentSplitter.h : Made logger protected. * src/SegmentSplitter.cc (Constructor): Use LogFactory. * src/SegmentMan.cc (Constructor): Use LogFactory. * src/DownloadEngine.h : Made logger protected. * src/DownloadEngine.cc (Constructor): Use LogFactory. * src/PeerInteractionCommand.cc : Use Command::logger. * src/HttpResponseCommand.cc : Use Command::logger. * src/SegmentMan.h : Made logger private. * src/TorrentMan.h : Made logger private. * src/TorrentMan.cc : Use LogFactory. * src/FtpNegotiateCommand.cc : Use Command::logger. * src/HttpConnection.h (Constructor): Deleted the argument logger. * src/HttpConnection.cc (Constructor): Deleted the argument logger. Use LogFactory. * src/FtpConnection.h (Constructor): Deleted the argument logger. * src/FtpConnection.cc (Constructor): Deleted the argument logger. Use LogFactory. * src/DownloadCommand.cc : Use Command::logger. * src/PeerAbstractCommand.cc : Use Command::logger. * src/PeerListenCommand.cc : Use Command::logger. * src/PeerInitiateConnectionCommand.cc : Use Command::logger. * src/HttpInitiateConnectionCommand.cc : Use Command::logger. * src/FtpInitiateConnectionCommand.cc : Use Command::logger. * src/TrackerWatcherCommand.cc : Use Command::logger. * src/TrackerUpdateCommand.cc : Use Command::logger. * src/TrackerDownloadCommand.cc : Use Command::logger. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger. Use LogFactory. * src/SendMessageQueue.h (Constructor): Deleted the argument logger. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger. Use LogFactory. * src/main.cc (main): Use LogFactory. * src/DiskAdaptor.h (logger): New variable. * src/DiskAdaptor.cc (Constructor): Use LogFactory. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
* * replaced std::vector with std::deque.Tatsuhiro Tsujikawa2006-03-221-2/+2
|
* added bittorrent support(experimental)Tatsuhiro Tsujikawa2006-03-211-25/+46
|
* * HttpConnection.cc:Tatsuhiro Tsujikawa2006-03-011-2/+2
| | | | | | * common.h: defined the user agent name as macro
* * HttpConnection.cc: Added "Proxy-Connection" header to proxy Tatsuhiro Tsujikawa2006-03-011-1/+4
| | | | | | | | | | request. Added "User-Agent" header to CONNECT proxy request. Fixed "Proxy-Authorization" header. Now proxy authorization works properly.
* (no commit message)Tatsuhiro Tsujikawa2006-02-221-4/+18
|
* (no commit message)Tatsuhiro Tsujikawa2006-02-211-2/+2
|
* (no commit message)Tatsuhiro Tsujikawa2006-02-211-10/+12
|
* (no commit message)Tatsuhiro Tsujikawa2006-02-211-53/+35
|
* replace unsgined int with string::size_type where comparisons to Tatsuhiro Tsujikawa2006-02-181-1/+1
| | | | | string::npos take place.
* (no commit message)Tatsuhiro Tsujikawa2006-02-181-0/+1
|
* Modify HttpConnection to not to send referer string when Tatsuhiro Tsujikawa2006-02-181-1/+4
| | | | | Request::getPreviousUrl() is empty.
* * Make Request-URI an absolute path. Some servers cannot permitTatsuhiro Tsujikawa2006-02-181-2/+2
| | | | | | absoluteURI as Request-URI.
* Added Referer supportTatsuhiro Tsujikawa2006-02-181-1/+1
|
* * Added HTTPS support.Tatsuhiro Tsujikawa2006-02-171-3/+6
| | | | | | | | | * Added SocketCore. Socket is now handle class for SocketCore. * Fixed bug in ChunkedEncoding: expanding buffer size is wrong * Fixed bug in DownloadCommand: In Chunked Encoding, it wrongly adds to Segment.ds buff length from the socket.
* Initial importTatsuhiro Tsujikawa2006-02-171-0/+156