summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2008-12-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-12-151-2/+5
| | | | | | | | | | | | | | | Fixed the bug that causes corrupted downloads if HTTP pipelining is enabled and the server doesn't support keep-alive. * src/AbstractCommand.cc * src/DownloadCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpResponseCommand.cc * src/Request.cc * src/Request.h * test/RequestTest.cc
* 2008-11-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-11-261-6/+29
| | | | | | | | | | | | | | | | | | | Fixed the bug that prevents aria2 from downloading 0-length files via HTTP/FTP. * src/DefaultBtContext.cc * src/DefaultBtContext.h * src/DownloadContext.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/RequestGroup.cc * src/SingleFileDownloadContext.cc * src/SingleFileDownloadContext.h * test/BtPostDownloadHandlerTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/MockBtContext.h
* 2008-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-11-231-14/+19
| | | | | | | | | | | | | | | | | | Use HEAD method to get file size from HTTP server for segmented downloading. The request to the BitTorrent Tracker always uses GET method because the response of the tracker is small and it doesn't need segmented download. * src/FtpNegotiationCommand.cc * src/HttpRequest.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/TrackerWatcherCommand.cc * test/HttpRequestTest.cc
* 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | AuthConfigFactory is now part of DownloadEngine. * src/AbstractProxyRequestCommand.cc * src/AuthConfigFactory.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpConnection.cc * src/FtpConnection.h * src/FtpNegotiationCommand.cc * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/MultiUrlRequestInfo.cc * src/main.cc * test/FtpConnectionTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc
* 2008-10-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-10-221-0/+2
| | | | | | | | | | Fixed the bug that causes time out when redirection occurs with content-length 0. * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h
* 2008-10-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-301-0/+7
| | | | | | | | | | | | | | | Don't set Request::supportsPersistentConnection() in HttpConnection since this code is also used in AbstractProxyResponseCommand. Moved those code to HttpResponse. * src/HttpResponse.cc * src/HttpResponse.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpResponseCommand.cc * test/HttpResponseTest.cc
* 2008-09-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the bug that HTTPS download fails. * src/AbstractCommand.cc * src/AbstractCommand.h * src/DownloadCommand.cc * src/FtpConnection.cc * src/HttpConnection.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/MSEHandshake.cc * src/PeerConnection.cc * src/SocketCore.cc * src/SocketCore.h Fixed the bug that aria2 doesn't download whole content body and cannot reuse connection if chunked transfer encoding and gzip content encoding are set. * src/DownloadCommand.cc * src/HttpSkipResponseCommand.cc
* 2008-09-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --max-file-not-found=NUM option. If aria2 receives `file not found' error from HTTP/FTP server NUM times without getting single bytes of data, then force the download to fail. Basically aria2 tris all URIs available. So if long list of URIs are specified in Metalink, then aria2 will take a long time to fail eventually if all URIs are outdated. This option eases this situation to limit the number of servers to try. * src/FtpNegotiationCommand.cc * src/HelpItemFactory.cc * src/HttpResponseCommand.cc * src/OptionHandlerFactory.cc * src/PeerStat.h * src/RequestGroup.cc * src/RequestGroup.h * src/SegmentMan.cc * src/SegmentMan.h * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.h
* 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the ability to get timestamp from remote HTTP server and apply it to local file. To enable this feature, --remote-time option is added. No usage text has been written yet. If several servers returns difference timestamp, then aria2 uses latest one. * src/CopyDiskAdaptor.cc * src/CopyDiskAdaptor.h * src/DirectDiskAdaptor.cc * src/DirectDiskAdaptor.h * src/DiskAdaptor.h * src/File.cc * src/File.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * test/CopyDiskAdaptorTest.cc * test/FileTest.cc * test/Makefile.am * test/Makefile.in * test/MultiDiskAdaptorTest.cc * test/TestUtil.cc
* 2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-011-27/+31
| | | | | | | | | | | | | | | | | Made files whose name ends with ".gz", ".tgz" not inflated by Content Encoding Decoder. Removed size threshold for turning off on the fly inflation because resulting file may or may not be inflated depending on the file size and I think it is not expected by users. This change fixes segmentation fault when Metalink file contains gzipped file and its filesize is provided. * src/HttpResponseCommand.cc * src/HttpResponseCommand.h
* 2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use CookieStorage class instead of CookieBox class. Now CookieStorage accepts cookies from numeric host such as 192.168.1.1. * src/AbstractProxyRequestCommand.cc * src/CookieStorage.cc * src/DownloadEngine.cc * src/DownloadEngine.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/Makefile.am * src/MultiUrlRequestInfo.cc * src/Request.cc * src/Request.h * src/main.cc * test/AllTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/NsCookieParserTest.cc * test/Sqlite3MozCookieParserTest.cc * test/nscookietest.txt
* 2008-08-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-08-031-1/+11
| | | | | | | | | | | Fixed the bug that causes segmentaion fault when resuming download using metalink without size tag. Reproducible only using HTTP URI. * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc
* 2008-07-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-311-2/+20
| | | | | | | | | | | | | | | | | | | | | Fixed broken gzip inflation. Turn off segmented downloading if gzip content is smaller than or equal to 1MiB and inflate the data on the fly, because HTTP response header doesn't contain the length of inflated file we can't determin where the chunk of data should be written. On the other hand, if gzip content is larger than 1MB, then turn off on the fly inflation, because some servers returns "content-type: gzip" for *.tgz, *.gz files. * src/DownloadCommand.cc * src/HttpResponseCommand.cc * src/HttpResponseCommand.h
* 2008-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-011-1/+0
| | | | | | | | | Removed TransferEncoding. * src/DownloadCommand.cc * src/DownloadCommand.h * src/HttpResponseCommand.cc
* 2008-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-011-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten ChunkedEncoding class as ChunkedDecoder class. * src/A2STR.cc * src/A2STR.h * src/ChunkedDecoder.cc * src/ChunkedDecoder.h * src/ChunkedEncoding.cc: Removed * src/ChunkedEncoding.h: Removed * src/DownloadCommand.cc * src/DownloadCommand.h * src/HttpDownloadCommand.cc * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/Makefile.am * src/TransferEncoding.h: Removed * test/ChunkedDecoderTest.cc * test/ChunkedEncodingTest.cc: Removed * test/HttpResponseTest.cc * test/Makefile.am
* 2008-06-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-06-291-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added gzip, deflate decoding support in HTTP using libz. If compiled with this feature, aria2 sends "Accept-Encoding: deflate, gzip" header to a HTTP server. If a server returns "Content-Encoding: gzip" or "Content-Encoding: deflate" then, aria2 decodes the response body on the fly and writes decoded data to a local disk. * README * README.html * configure.ac * m4/aria2_arg.m4: Added ARIA2_ARG_WITH and ARIA2_ARG_ENABLE, they are wrapper function for AC_ARG_WITH and AC_ARG_ENABLE respectively. * m4/libz.m4 * src/Decoder.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/Exception.h * src/GZipDecoder.cc * src/GZipDecoder.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/Makefile.am * test/GZipDecoderTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/Makefile.in * test/gzip_decode_test.gz
* 2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-141-1/+2
| | | | | | | | | | | | Defined HTTP status as static const std::string * src/AbstractProxyResponseCommand.cc * src/HttpHeader.cc * src/HttpHeader.h * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc
* 2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-101-2/+2
| | | | | | | | | Renamed HttpNullDownloadCommand as HttpSkipResponseCommand * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h
* 2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-101-21/+14
| | | | | | | | | | | | | Pool connection when a server returns 4xx, 5xx responses. * src/HttpNullDownloadCommand.cc * src/HttpNullDownloadCommand.h * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * test/HttpResponseTest.cc
* 2008-05-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-061-5/+37
| | | | | | | | | | | | Receive content body of 302 response so that the connection can be reused later when http keep-alive is enabled. * src/HttpNullDownloadCommand.cc * src/HttpNullDownloadCommand.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h
* 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-271-5/+8
| | | | | | | | | | | | | Rewritten Exception class. Throw exception object, not its pointer and catch by reference, so that remove problematic delete operator for catched exception. * src/Exception.cc * src/Exception.h * test/ExceptionTest.cc * src/*: All files throwing/catching exception. * test/*: All files throwing/catching exception.
* 2008-04-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-221-1/+7
| | | | | | | | | | | | | | | | | Reuse socket if the origin server supports HTTP keep-alive and --enable-http-keep-alive or --enable-http-pipelining is given. The current implementation doesn't reuse the connections established against proxy server. * src/AbstractCommand.cc * src/DownloadEngine.cc * src/DownloadEngine.h * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpResponseCommand.cc
* 2008-04-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-221-2/+0
| | | | | | | | | | | | | | | | | | Rewritten HTTP keep-alive and pipelining routine. * src/AbstractCommand.cc * src/HttpConnection.cc * src/HttpDownloadCommand.cc * src/HttpRequest.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/Request.cc * src/Request.h * src/RequestGroup.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/RequestTest.cc
* 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminates the time lag between sequential downloads and commands in the same RequestGroup. In old implementation, aria2 occasionally waits 1 seconds before executing next command or RequestGroup. This is really a waste of time, and new implementation eliminates this unnecessary time lag. * src/AbstractCommand.cc * src/AutoSaveCommand.cc * src/CheckIntegrityCommand.cc * src/Command.{cc, h} * src/DownloadEngine.{cc, h} * src/DownloadEngineFactory.cc * src/FileAllocationCommand.cc * src/FileAllocationDispatcherCommand.cc * src/FillRequestGroupCommand.cc * src/FtpInitiateConnectionCommand.cc * src/HaveEraseCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpResponseCommand.cc * src/RealtimeCommand.cc * src/RequestGroup.cc * src/RequestGroupMan.cc * src/StreamFileAllocationEntry.cc * src/TimeBasedCommand.{cc, h} * src/TimedHaltCommand.cc
* 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-201-3/+4
| | | | | | | | | | | | | | | Rewritten SharedHandle. Now copy constructor taking raw pointer has keyword explicit and SharedHandle's default constructor initializes its internal obj to null, old implementation initializes it using obj's default constructor. To assign null, write SharedHandle<T> x(...); x.reset(); TODO: test/SharedHandleTest.cc needs more tests. * src/SharedHandle.h
* 2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-091-1/+1
| | | | | | type cleanup for allmost all remaining files.
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-11/+21
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-12-221-0/+2
| | | | | | | | | | | | | | | | | | | | | Fixed the bug that causes aria2 not to finish download. BUG#1855875. I could reproduce this bug in following procedure: 1. Stop the download at the very beginning(1% or 100KB downloaded). 2. Restart aria2. 3. You see the download stopped around 99%. * src/HttpResponseCommand.cc (handleDefaultEncoding) * src/StreamFileAllocationEntry.cc: Removed the timeout handling. If timeout is reached, then _nextCommand is unused and it may contains segments and they won't be canceled. Actually, timeout is not needed here because if the server dropped connection, then retry is made.
* 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-12-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | If several protocols are available for a mirror, aria2 now use one of them. --metalink-preferred-protocol option was added to specify the preference of protocol. * src/AbstractCommand.cc * src/OptionHandlerFactory.cc * src/ServerHost.{h, cc} * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * test/RequestGroupTest.cc * src/option_processing.cc * src/prefs.h * src/HttpResponseCommand.cc * src/MetalinkResource.{h, cc} * src/FtpNegotiationCommand.cc * src/MetalinkEntry.{h, cc} * src/MetalinkEntryTest.cc
* 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-12-041-1/+0
| | | | | | | | | | | | Forced download abort when received negative response from http/ftp server. * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/HttpResponse.cc * src/FtpConnection.cc
* 2007-12-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-12-011-1/+3
| | | | | | | | | | | | | | | Fixed the bug#1841757: aria2 will connect to server to only get file size. * src/StreamFileAllocationEntry.cc * src/option_processing.cc * src/HttpResponseCommand.cc: Now reuse connection in segmented downloads. * src/FtpNegotiationCommand.cc Suppressed wrong message when finding PreDownloadHandler * src/RequestGroup.cc
* 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-271-0/+1
| | | | | | | | | | | Set Content-Type to SingleFileDownloadContext when http response is received. * src/HttpResponseCommand.cc * src/HttpResponse.{h, cc} * test/HttpResponseTest.cc
* 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
* 2007-11-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-181-2/+0
| | | | | | | | | | | | | | | | | | | | | * src/version_usage.cc (showVersion): Reworked. (showUsage): Added examples. Removed Hint for total length and file name. * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Now --follow-torrent and --follow-metalink option work properly. * src/RequestGroup.cc Updated man page * doc/aria2c.1.txt * doc/aria2c.1
* 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-131-0/+6
| | | | | | | | | | | Added the ability to detect duplicate download entry which is about to download the same file other RequestGroup is downloading. * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc
* 2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-091-30/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
* 2007-11-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-071-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflect the download length of in-flight pieces. It makes the download length readout more precise. * src/DefaultPieceStorage.{h, cc} * test/DefaultPieceStorageTest.cc * src/a2functional.h * test/a2functionalTest.cc Lower CPU load when --max-download-limit is used. There is up and down in speed indicator when enabling http-pipelining but a download goes well. I think the problem is that because http-pipelining is enabled, DownloadCommand is created for each segment and in its constructor, PeerStat::downloadStart() is called. In PeerStat::downloadStart(), speed calculation object is reseted, which makes download speed zero. * src/DownloadCommand.cc Rewritten using accumulate. * src/RequestGroupMan.cc (calculateStat) Code clearnup. * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc
* 2007-11-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-051-2/+4
| | | | | | | | | Fixed: Can not resume: aria2 reports download already finished. * src/AbstractCommand.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc
* 2007-11-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now a file is stored in the directory specified in .metalnk file (file[@name]). * src/Metalink2RequestGroup.cc Create the directory structure when opening the file if it doesn't exist. * src/AbstractDiskWriter.cc * src/Util.{h, cc} * src/File.h * test/UtilTest.cc Removed file name comparison * src/Metalink2RequestGroup.cc * src/HttpResponseCommand.cc Rewritten using Util::mkdirs() * src/FileEntry.cc (setupDir) * test/FileEntryTest.cc Updated doc * src/SingleFileDownloadContext.h
* 2007-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added HTTP/1.1 keep alive and pipelining support. See --enable-http-keep-alive and --enable-http-pipelining option. * src/AbstractCommand.{h, cc}: Now it has one-to-many relation to Segment. * src/HttpDownloadCommand.{h, cc} * src/OptionHandlerFactory.cc * src/HttpConnection.{h, cc} * src/version_usage.cc * src/HttpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.cc * src/Segment.h * src/HttpRequestCommand.{h, cc} * src/option_processing.cc * src/prefs.h * src/HttpResponseCommand.cc * src/SegmentMan.{h, cc} * src/FtpNegotiateCommand.cc * src/HttpProxyResponseCommand.cc * src/Request.cc * src/HttpRequest.cc * src/DownloadCommand.cc * test/HttpRequestTest.cc * test/RequestTest.cc
* 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-111-42/+30
| | | | | | | | | | Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
* 2007-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-08-281-4/+0
| | | | | | | | | | | | | | | | | | | | | Added auto file renaming feature in http(s)/ftp download. * src/main.cc: Added --auto-file-renaming command-line option. * src/OptionHandlerFactory.cc * src/prefs.h: Added PREF_AUTO_FILE_RENAMING * src/RequestGroup.{h, cc} (shouldCancelDownloadForSafety): Rewritten (tryAutoFileRenaming): New function. * src/SegmentMan.{h, cc} (shouldCancelDownloadForSafety): Removed. * src/HttpResponseCommand.cc (executeInternal): Removed the call to RequestGroupMan:: isSameFileBeingDownloaded() * src/FtpNegotiateCommand.cc (recvSize): Removed the call to RequestGroupMan:: isSameFileBeingDownloaded() * test/RequestGroupTest.cc: New class.
* 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged Ross's win32 patch(manually) In the course of merging, following files are added. * src/strptime.{h,c} * src/libgen.{h,c} * src/inet_aton.{h,c} * src/Platform.{h,cc} * src/localtime_r.{h,c} * src/getaddrinfo.{h,c} I've gethered network related things, and put them to following file: * src/a2netcompat.h Also io related things are put to following file: * src/a2io.h Changed %lld to %s because mingw32 doesn't recognize %lld. * src/message.h (MSG_ALLOCATION_COMPLETED) (EX_TOO_LARGE_FILE) (EX_SIZE_MISMATCH) (EX_FILE_OFFSET_OUT_OF_RANGE) (EX_INVALID_CHUNK_CHECKSUM) (EX_INVALID_RANGE_HEADER) * src/FileAllocationCommand.cc * src/HttpResponse.cc * src/RequestGroup.cc * src/MultiDiskAdaptor.cc * src/OptionHandlerImpl.h * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc * src/IteratableChecksumValidator.cc * src/SegmentMan.cc * src/ChunkChecksumValidator.cc Added Randomizer::getRandomNumber(long int) * src/Randomizer.h (getRandomNumber) * src/SimpleRandomizer.h (getRandomNumber) * src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function. * src/Util.cc (randomAlpha): Use this new function.
* 2007-07-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-181-6/+11
| | | | | | | | | | | | | Fixed the bug that prevents filename in content-disposition from being retrieved when filename is not quoted. * src/Util.cc (getContentDispositionFilename) Fixed the bug that causes infinate loop and memory leak when file open operation failed. * src/HttpResponseCommand.cc (handleDefaultEncoding)
* 2007-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-06-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/AbstractCommand.cc (execute): Changed log level of MSG_RESTARTING_DOWNLOAD and MSG_MAX_TRY from error to info. Added MSG_DOWNLOAD_ABORTED after MSG_MAX_TRY. * src/message.h (MSG_TORRENT_DOWNLOAD_ABORTED): New definition. (MSG_DOWNLOAD_ABORTED): Added %s. (MSG_RESTARTING_DOWNLOAD): Added %s. (MSG_DOWNLOAD_ALREADY_COMPLETED): Updated. * src/PeerAbstractCommand.cc (execute): MSG_DOWNLOAD_ABORTED -> MSG_TORRENT_DOWNLOAD_ABORTED * src/Request.h (cookieBox): Made ShardHandle. * src/RequestGroup.h, src/RequestGroup.cc (createNextCommandWithAdj): New function. * src/FileAllocationCommand.cc (executeInternal): Use createNextCommandWithAdj(). * src/CheckIntegrityCommand.cc (executeInternal): Use createNextCommandWithAdj(). Added --load-cookies command-option. * src/OptionHandlerFactory.cc (createOptionHandlers): Added PREF_LOAD_COOKIES. * src/CookieBox.h, src/CookieBox.cc: Rwritten using CookieParser. Now aria2 can handle cookie's expiration date. * src/Cookie.h (expires): Changed its type to time_t. * src/main.cc: Added --load-cookies command-line option. * src/prefs.h (PREF_LOAD_COOKIES): New definition. * src/Util.h, src/Util.cc (httpGMT): New function. * src/Request.cc (Request): Initialize cookieBox using CookieBoxFactory. * src/CookieBoxFactory.h, src/CookieBoxFactory.cc: New class. * src/CookieParser.h, src/CookieParser.cc: New class. * src/main.cc: Chagned the default value of --metalink-servers to 5. * src/HttpResponseCommand.cc (handleOtherEncoding): Call RequestGroup::shouldCancelDownloadForSafety
* (no commit message)Tatsuhiro Tsujikawa2007-06-091-2/+1
|
* 2007-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-06-031-0/+5
| | | | | | | | | | | | | | | | | | | | | RequestGroup::getNextCommand() was renamed to createNextCommand(). Added its overloaded method. * src/RequestGroup.h (_numConcurrentCommand): New variable. (setNumConcurrentCommand): New function. * src/RequestGroup.cc Abort download if same file is being downloaded concurrently. * src/RequestGroup.h, src/RequestGroupMan.cc (isSameFileBeingDownloaded): New function. * src/HttpResponseCommand.cc (executeInternal) * src/FtpNegotiateCommand.cc (recvSize) * src/message.h (EX_DUPLICATE_FILE_DOWNLOAD): New definition. * main.cc: Added help message for -i option.
* 2007-06-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-05-311-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/FileAllocationCommand.cc: Derived from RealtimeCommand. * src/CheckIntegrityCommand.cc: Derived from RealtimeCommand. * src/MetalinkEntry.h (checksum): Changed to ChecksumHandle * src/MetalinkRequestInfo.cc (checksum): Changed to ChecksumHandle * src/File.cc (mkdirs): OPEN_MODE -> DIR_OPEN_MODE * src/common.h (DIR_OPEN_MODE): New definition * src/RequestGroup.cc (prepareForNextAction): Added an argument. * src/message.h (MSG_GOOD_CHECKSUM): New definition (MSG_BAD_CHECKSUM): New definition * src/HttpResponseCommand.cc (handleDefaultEncoding): Continue download sequence in new non-segmented download. * src/FileAllocationEntry.h (_nextDownloadCommand): New variable. * src/DownloadCommand.cc (prepareForNextSegment): Create ChecksumCommand if checksum is available. * src/RealtimeCommand.h, src/RealtimeCommand.cc: New class. * src/IteratableChecksumValidator.h, src/IteratableChecksumValidator.cc: New class. * src/ChecksumCommand.h, src/ChecksumCommand.cc: New class.
* 2007-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-05-201-34/+43
| | | | | | * Added the simultaneous download feature.
* 2007-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-151-126/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To handle Segment as SegmentHandle: * src/AbstractCommand.cc (execute): Rewritten. * src/SegmentMan.h: Segment -> SegmentHandle Introducded HttpResponse class, HttpRequest class to improve code extensiveness and make it clear: * src/HttpDownloadCommand.cc: transfer encoders are now managed by HttpResponse class. * src/HttpRequest.h, src/HttpRequest.cc: New class. * src/HttpResponse.h, src/HttpResponse.cc: New class. * src/HttpConnection.cc: Contruction of http request were moved to HttpRequest class. * src/HttpResponseCommand.h, src/HttpResponseCommand.cc: Refactored. * src/HttpRequestCommand.cc (executeInternal): Rewritten. * src/HttpAuthConfig.h: New class. * src/Range.h: New class. To make FtpTunnel{Request, Response}Command and HttpProxy{Request, Response}Command derived from AbstractProxy{Request, Response}Command: * src/FtpTunnelResponseCommand.h, src/FtpTunnelResponseCommand.cc: Derived from AbstractProxyRequestCommand class. * src/FtpTunnelRequestCommand.h, src/FtpTunnelRequestCommand.cc: Derived from AbstractProxyResponseCommand class. * src/HttpProxyRequestCommand.h, src/HttpProxyRequestCommand.cc: Derived from AbstractProxyRequestCommand class. * src/HttpProxyResponseCommand.h, src/HttpProxyResponseCommand.cc: Derived from AbstractProxyResponseCommand class. * src/AbstractProxyRequestCommand.h, src/AbstractProxyRequestCommand.cc : New class. * src/AbstractProxyResponseCommand.h, src/AbstractProxyResponseCommand.cc: New class. To add netrc support: * src/Netrc.h, src/Netrc.cc: New class. * src/Util.h, src/Util.cc (split): New function. * src/HttpHeader.cc (getRange): Fixed so that it inspects "Content-Range" header instead of "Range" header. * src/HttpHeader.h (getStatus): Removed. (setStatus): Removed. * src/Segment.h (getPositionToWrite): New function.