summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use 64 bits random bytes as GIDTatsuhiro Tsujikawa2012-12-161-2/+2
| | | | | | | | | | This change replaces the current 64 bit sequential GID with 64 bits random bytes GID in an attempt to support persistent GID. Internally, the GID is stored as uint64_t. For human representation and RPC interface, GID is represented as 16 bytes hex string. For console readout, 16 bytes are too long, so it is abbreviated to first 6 bytes. When querying GID in RPC calls, user can speicfy the prefix of GID as long as the prefix is shared by more than 1 GID entries.
* Use uri_split instead of uri::parse where appropriateTatsuhiro Tsujikawa2012-10-141-3/+5
|
* Removed trailing spacesTatsuhiro Tsujikawa2012-10-011-1/+1
|
* Removed *Handle typedefTatsuhiro Tsujikawa2012-09-281-3/+3
|
* Rewritten DownloadHandlerConstantsTatsuhiro Tsujikawa2012-09-221-3/+3
| | | | | | | | | | DownloadHandlerConstants was simplified. MIME type handling in Accept header was also reworked. DownloadContext's metalinkServerContacted_ is replaced with acceptMetalink_ and its boolean value is reverted. RequestGroup and HttpRequest now do not hold vector of accepting types. HttpRequest has the flag acceptMetalink_ which will be set by the same value of DownloadContext::accpetMetalink_ and if it is true, Metalink MIME types are added to Accept header field.
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-2/+2
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* aria2 now doesn't assume download's completed just because file size matchedTatsuhiro Tsujikawa2012-01-081-13/+39
| | | | | | | | The only exception is zero-length file. If server tells file is zero-length and --checksum option is given, aria2 now correctly checks its checksum. There is one known issue: If downloaded file is zero-length file and .aria2 file exists, it will not be deleted on successful verification, because .aria2 file is not loaded.
* Replaced uint64_t with off_t or int64_t.Tatsuhiro Tsujikawa2011-12-091-2/+2
| | | | | Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
* Use %lld to fomat a2_gid_tTatsuhiro Tsujikawa2011-12-021-2/+2
|
* Removed utf8ToNative from log message and exception message.Tatsuhiro Tsujikawa2011-08-081-3/+3
|
* In MinGW32, open file with UNICODE filename and print them in ANSI.Tatsuhiro Tsujikawa2011-08-041-7/+9
|
* Consistent naming scheme for hash type and digest for DownloadContext.Tatsuhiro Tsujikawa2011-07-271-6/+5
|
* Consistent naming scheme for hash type and digest.Tatsuhiro Tsujikawa2011-07-271-6/+6
|
* Implemented Metalink/HTTP in HTTP download.Tatsuhiro Tsujikawa2011-07-271-0/+70
| | | | | | | | | | Link header fields from first Metalink server is utilized as described in rfc6249. We only set digest from Digest header field to DownloadContext only when PieceStorage is not initialized(in other words, before file size is known). After PieceStorage is initialized, Digest header field is used to check the value is the same in digest in DownloadContext. Current implementation only handles rel=duplicate.
* Remove Metalink content-type after first server response.Tatsuhiro Tsujikawa2011-07-251-0/+1
| | | | We don't accept Metalink content-type after first server response.
* Replaced HAVE_LIBZ with HAVE_ZLIBTatsuhiro Tsujikawa2011-02-181-4/+4
|
* Accept HTTP 304 reply as success when If-None-Match request-headerTatsuhiro Tsujikawa2011-01-291-19/+15
| | | | | | | field is specified using --header option. When --conditional-get is used, --allow-overwrite is now required to overwrite existing file.
* Handle the situation when remote server returns Connection: closeTatsuhiro Tsujikawa2011-01-161-0/+2
| | | | | | | | after several pipelined requests. We call Request::setMaxPipelinedRequest(1) if Connection: close is received. Also call Request::supportsPersistentConnection(true) and Request::setMaxPipelinedRequest(1) when closing the connection.
* Eliminated SocketCore::peekData() form HTTP/FTP downloads.Tatsuhiro Tsujikawa2011-01-161-2/+6
| | | | | | | | | | We introduced SocketRecvBuffer which buffers received bytes. Since HTTP response header and response body are divided with \r\n, we have to buffer up several bytes to find this delimiter. We use SocketRecvBuffer to hold these bytes and only consumes header and passes SocketRecvBuffer, which may contain head of response body, to next Command. Since FTPConnection doesn't use SocketCore::peekData(), we left it as is.
* Removed DownloadContext::dir_. Use PREF_DIR value instead.Tatsuhiro Tsujikawa2010-12-031-1/+1
|
* Added additional error_code::Values(9 through 14).Tatsuhiro Tsujikawa2010-11-281-2/+3
|
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-5/+4
| | | | | | Replaced StringFormat with fmt
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-13/+14
| | | | | | | Rewritten Logger interface. Logger now writes source file name and line number in log file.
* 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-151-6/+5
| | | | | | | | | | | | | | | | | | | | | | Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_. statusCode_ is of type int. * src/AbstractProxyResponseCommand.cc * src/FtpNegotiationCommand.cc * src/HttpHeader.cc * src/HttpHeader.h * src/HttpHeaderProcessor.cc * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/util.cc * src/util.h * test/HttpHeaderProcessorTest.cc * test/HttpHeaderTest.cc * test/HttpResponseTest.cc * test/UtilTest.cc
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-2/+0
| | | | | | | | | Added .cc file for classes/structs that only provided by header file. Defined non-POD classes' ctor, dtor in .cc file. Moved implementation code in header file to .cc file for major classes/strucsts.
* 2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-121-10/+10
| | | | | | | | Removed SharedHandle::isNull(). Instead we added operator* and operator unspecified_bool_type. Removed use of WeakHandle and replaced with raw pointer.
* 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-111-5/+4
| | | | | | | | | | | | | | Create SharedHandle outside of function call to avoid unexpected memory leak. * src/AnnounceList.cc * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/RequestGroup.cc * src/RequestGroupMan.cc * src/UTMetadataPostDownloadHandler.cc * src/download_helper.cc
* 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-301-50/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use unnamed namespace instead of static keyword. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/Base64.cc * src/BitfieldMan.cc * src/BtDependency.cc * src/ConsoleStatCalc.cc * src/ContentTypeRequestGroupCriteria.cc * src/CookieStorage.cc * src/DHTMessageFactoryImpl.cc * src/DHTRoutingTableDeserializer.cc * src/DefaultBtAnnounce.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadCommand.cc * src/DownloadEngine.cc * src/EpollEventPoll.cc * src/ExpatMetalinkProcessor.cc * src/ExpatXmlRpcRequestProcessor.cc * src/FileEntry.cc * src/HttpRequest.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/KqueueEventPoll.cc * src/LongestSequencePieceSelector.cc * src/MetalinkParserStateV3Impl.cc * src/MetalinkParserStateV4Impl.cc * src/MultiDiskAdaptor.cc * src/MultiUrlRequestInfo.cc * src/OptionParser.cc * src/PeerSessionResource.cc * src/PortEventPoll.cc * src/Request.cc * src/RequestGroupMan.cc * src/SelectEventPoll.cc * src/SessionSerializer.cc * src/SimpleLogFormatter.cc * src/Sqlite3CookieParser.cc * src/TrackerWatcherCommand.cc * src/XML2SAXMetalinkProcessor.cc * src/Xml2XmlRpcRequestProcessor.cc * src/XmlRpcMethod.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcResponse.cc * src/base32.cc * src/bencode2.cc * src/bittorrent_helper.cc * src/download_helper.cc * src/main.cc * src/messageDigest.cc * src/option_processing.cc * src/util.cc * test/AnnounceListTest.cc * test/BtRegistryTest.cc * test/DHTBucketTest.cc * test/DHTRoutingTableTest.cc * test/DefaultBtAnnounceTest.cc * test/FileEntryTest.cc * test/FtpConnectionTest.cc * test/MSEHandshakeTest.cc * test/MagnetTest.cc * test/XmlRpcMethodTest.cc * test/array_funTest.cc
* 2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-191-1/+4
| | | | | | | | Fixed the bug that file allocation is enabled in HTTP even if --file-allocation=none is specified. * src/HttpResponseCommand.cc
* 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-021-3/+2
| | | | | | | | | | | | | | | | | | Non-UTF8 filenames are now percent-encoded. For example, filename for http://example.org/%90%A2%8AE will be %90%A2%8AE because it is Shift_JIS. The comments and name in .torrent file in XML-RPC response are percent-encoded if they are not UTF-8. * src/FtpNegotiationCommand.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/util.cc * src/util.h * test/BittorrentHelperTest.cc * test/UtilTest.cc
* 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-151-17/+9
| | | | | | | | | | | | | | | | | | | | | | Fixed the bug that a file gets overwritten if -V is given and no hash is provided. Fixed the bug that --dry-run leads download error. Added RequestGroup::createCheckIntegrityEntry() which correctly creates CheckIntegrityEntry objects and open files based on -V option and the existence of control file. * src/AbstractCommand.cc * src/AbstractCommand.h * src/ChecksumCheckIntegrityEntry.cc * src/DownloadContext.cc * src/DownloadContext.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/PieceHashCheckIntegrityEntry.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupEntry.cc * src/RequestGroupEntry.h
* 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-131-1/+5
| | | | | | | Fixed compile error without zlib * src/HttpResponseCommand.cc
* 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-131-1/+5
| | | | | | | | | Updated doc * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/RequestGroup.cc
* 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-131-14/+19
| | | | | | | | Fixed the bug that error occurs when downloading zero-length file. * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc
* 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE. * src/AbstractCommand.cc * src/HttpResponseCommand.cc * src/Option.cc * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/TrackerWatcherCommand.cc * src/download_helper.cc * src/main.cc * src/prefs.cc * src/prefs.h * test/AuthConfigFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DownloadHelperTest.cc * test/HttpRequestTest.cc * test/OptionHandlerTest.cc * test/UTMetadataPostDownloadHandlerTest.cc * test/XmlRpcMethodTest.cc
* 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-3/+5
| | | | | | | | | | | | | | | | Use uri::parse instead of Request::setUri() where just URI parser is needed. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/DefaultBtAnnounce.cc * src/FeedbackURISelector.cc * src/FileEntry.cc * src/HttpResponseCommand.cc * src/ProtocolDetector.cc * src/Request.cc * src/RequestGroupMan.cc
* 2010-09-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-101-11/+11
| | | | | | | | | | | | | | | Check hash(hash for entire file, not piece hash) if --check-integrity option is given and file is downloaded(determined by file length). If it fails, re-download file. * src/AbstractCommand.cc * src/ChecksumCheckIntegrityEntry.cc * src/ChecksumCheckIntegrityEntry.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/RequestGroup.cc
* 2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-081-0/+9
| | | | | | | | | | Fixed the bug that aria2 reports error and exits with non-zero status when file is already downloaded. * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/RequestGroup.cc
* 2010-09-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-061-2/+4
| | | | | | | Parse original URI when removing same host. * src/HttpResponseCommand.cc
* 2010-09-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-061-42/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Data from remote server in HTTP/FTP download are now written to the disk(or memory) through StreamFilter. Decoding chunked and gziped streams are done cascading StreamFilter. Removed inefficient 1byte read code. * src/ChunkedDecodingStreamFilter.cc * src/ChunkedDecodingStreamFilter.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/GZipDecodingStreamFilter.cc * src/GZipDecodingStreamFilter.h * src/HttpConnection.cc * src/HttpDownloadCommand.cc * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/Makefile.am * src/NullSinkStreamFilter.cc * src/NullSinkStreamFilter.h * src/RequestGroup.cc * src/SinkStreamFilter.cc * src/SinkStreamFilter.h * src/StreamFilter.cc * src/StreamFilter.h * test/ChunkedDecodingStreamFilterTest.cc * test/GZipDecodingStreamFilterTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/MockSegment.h
* 2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Pass maxSplitSize as an argument, instead of member variable of DefaultPieceStorage. SegmentMan::getSegment(cuid_t,size_t index) was renamed to SegmentMan::getSegmentWithIndex(...) * src/AbstractCommand.cc * src/AbstractCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/PieceStorage.h * src/RequestGroup.cc * src/SegmentMan.cc * src/SegmentMan.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h * test/SegmentManTest.cc
* 2010-07-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-161-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --conditional-get option. Download file only when the local file is older than remote file. This function only works with HTTP(S) downloads only. It does not work if file size is specified in Metalink. It also ignores Content-Disposition header. If a control file exists, this option will be ignored. This function uses If-Modified-Since header to get only newer file conditionally. When getting modification time of local file, it uses user supplied filename(see --out option) or filename part in URI if --out is not specified. * doc/aria2c.1.txt * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/OptionHandlerFactory.cc * src/TimeA2.cc * src/TimeA2.h * src/prefs.cc * src/prefs.h * src/usage_text.h * test/HttpResponseTest.cc * test/TimeTest.cc
* 2010-07-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Added --max-connection-per-server=NUM option. The default value of NUM is 1. This option limits the number of connections allowed to one server for each download. This means when NUM is 2 and 1 URI is provided, even if you specified -s 5, aria2 establishes 2 connections. Default value of -j option is changed from 5 to 2. * src/BtDependency.cc * src/CreateRequestCommand.cc * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/Metalink2RequestGroup.cc * src/OptionHandlerFactory.cc * src/TrackerWatcherCommand.cc * src/download_helper.cc * src/prefs.cc * src/prefs.h * src/usage_text.h * test/DownloadHelperTest.cc * test/FileEntryTest.cc
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-5/+5
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-091-79/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made protected member variable private. Added accessor funcs. * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/AbstractProxyRequestCommand.h * src/AbstractProxyResponseCommand.cc * src/AbstractProxyResponseCommand.h * src/CreateRequestCommand.cc * src/DownloadCommand.cc * src/DownloadCommand.h * src/FtpDownloadCommand.cc * src/FtpDownloadCommand.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/FtpTunnelRequestCommand.cc * src/FtpTunnelResponseCommand.cc * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpProxyRequestCommand.cc * src/HttpProxyResponseCommand.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommand.cc
* 2010-06-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-081-15/+20
| | | | | | | Made protected member variables of Command private. Added accessor funcs.
* 2010-06-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-081-6/+9
| | | | | | | Made public member variables of DownloadEngine private. Added accessor funcs.
* 2010-06-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-011-32/+28
| | | | | | | | | | Fixed double memory free when Exception raised from AbstractCommand::prepareForNextAction() called by HttpResponseCommand::handleDefaultEncoding(). * src/AbstractCommand.cc * src/HttpResponseCommand.cc
* 2010-05-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-05-211-1/+1
| | | | | | | | | | | | | | | | | Fixed the bug that connection pooling does not take into account proxy. This means that when connection A via proxy X is pooled, it will be wrongly reused in the download using proxy Y. * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc
* 2010-04-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-021-1/+2
| | | | | | | Possible fix for chunked encoding with Content-Length. * src/HttpResponseCommand.cc