summaryrefslogtreecommitdiff
path: root/src/DownloadCommand.cc
Commit message (Collapse)AuthorAgeFilesLines
* Take into account timeoutTatsuhiro Tsujikawa2016-06-211-1/+1
|
* Ensure that lowest speed check is done even when download speed is 0Tatsuhiro Tsujikawa2016-06-211-0/+4
|
* Updating upload size and speed must be done separatelyTatsuhiro Tsujikawa2016-01-051-2/+2
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-119/+133
|
* Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-1/+1
|
* sftp: basic download worksTatsuhiro Tsujikawa2015-05-121-2/+8
| | | | | | This commits implements basic downloading feature for sftp URI. This includes segmented downloads, and connection (sftp session) pooling. Download via HTTP proxy has not been implemented yet.
* SocketRecvBuffer: Eliminate memmoveTatsuhiro Tsujikawa2015-04-141-1/+1
| | | | | | Since we don't try to read into buffer if buffer is not empty, we don't have to memmove things. This commit mostly rewrites SocketRecvBuffer.
* Fixed some typos in code commentsDan Fandrich2015-01-161-1/+1
|
* Remove ENABLE_MESSAGE_DIGEST, since we got the internal md, alwaysNils Maier2014-04-171-17/+2
|
* Fix some warningsNils Maier2014-04-131-4/+0
|
* Stuff memory holesNils Maier2013-12-091-8/+6
| | | | | | | | | | | | | | | | | | Padding changes on x86_64: - RequestGroup: 29 -> 5 bytes - DownloadContext: 25 -> 1 bytes - Cookie: 20 -> 4 bytes - Command: 8 -> 0 bytes (affects many derived as well) - HttpRequest: 20 -> 4 bytes - DownloadCommand: 18 -> 2 bytes - TimeBasedCommand: 14 -> 6 bytes - AbstractCommand: 13 -> 5 bytes - HttpSkipResponseCommand: 12 -> 4 bytes - FileEntry: 10 -> 2 bytes - DownloadResult: 15 -> 7 bytes - UriStruct: 12 -> 4 bytes - Piece: 11 -> 3 bytes - BitfieldMan -> 11 -> 3 bytes
* Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntryTatsuhiro Tsujikawa2013-07-061-3/+3
|
* Use std::unique_ptr for StreamFilter instead of std::shared_ptrTatsuhiro Tsujikawa2013-07-041-6/+5
|
* Wrap Command object in std::unique_ptrTatsuhiro Tsujikawa2013-06-231-3/+3
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-14/+14
|
* Flush cached data on checkout/cancel SegmentTatsuhiro Tsujikawa2012-12-061-1/+1
| | | | This change prevents the cached data from overlap because of BT peers.
* Clear write cache on Segment::clear and Piece::clearAllBlockTatsuhiro Tsujikawa2012-12-061-18/+3
|
* Added --disk-cache optionTatsuhiro Tsujikawa2012-12-031-12/+62
| | | | | | | | | | This option enables disk cache. If SIZE is 0, the disk cache is disabled. This feature caches the downloaded data in memory, which grows to at most SIZE bytes. The cache storage is created for aria2 instance and shared by all downloads. The one advantage of the disk cache is reduce the disk seek time because the data is written in larger unit and it is reordered by the offset of the file. If the underlying file is heavily fragmented it is not the case.
* Reworked download/upload statistics calculationTatsuhiro Tsujikawa2012-10-251-0/+1
| | | | | | | | | | | | | | The old implementation calculates download/upload statistics for a RequestGroup by summing up all PeerStat objects. For global statistics, those are summed together. This clearly incurs runtime penalty and we introduced some kind of caching which updates statistics every 250ms but it did not work right. This change removes all these aggregation code, and instead makes RequestGroup and RequestGroupMan objects hold NetStat object and download/upload bytes are directly calculated by thier own NetStat. This is far more simplar than the old way and less runtime penalty and brings more accuracy.
* Made HTTP/FTP download speed limiter more accurateTatsuhiro Tsujikawa2012-10-241-1/+0
| | | | We have to do the same thing for BitTorrent.
* Removed *Handle typedefTatsuhiro Tsujikawa2012-09-281-2/+2
|
* Use std::vector instead of std::map for ContextAttribute objectsTatsuhiro Tsujikawa2012-09-221-1/+1
| | | | Now key for ContextAttribute object store is int instead of string.
* Removed static_cast<int64>()s where they are unnecessaryTatsuhiro Tsujikawa2012-06-251-1/+1
|
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-2/+2
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* Use PRId64 for int64_t format specifierTatsuhiro Tsujikawa2012-06-251-1/+1
|
* Use short form of util::startsWith and util::endsWithTatsuhiro Tsujikawa2012-01-111-4/+1
|
* Use int instead of unsigned int where unsigned int is not needed.Tatsuhiro Tsujikawa2011-12-091-1/+1
|
* Use int32_t for piece length instead of size_tTatsuhiro Tsujikawa2011-12-091-2/+4
|
* 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 fmt instead of util::itosTatsuhiro Tsujikawa2011-11-131-1/+1
|
* Removed util::endsWith(a, b). Added util::iendsWith()Tatsuhiro Tsujikawa2011-11-051-1/+4
|
* Stored hash value as raw byte string, instead of hex digest.Tatsuhiro Tsujikawa2011-10-131-8/+8
|
* wallclock is now retrieved using global::wallclock() call.Tatsuhiro Tsujikawa2011-08-101-1/+1
| | | | | This is necessary to avoid global variable initialization order problem.
* Consistent naming scheme for hash type and digest for DownloadContext.Tatsuhiro Tsujikawa2011-07-271-2/+2
|
* Renamed MessageDigestHelper as message_digest_helperTatsuhiro Tsujikawa2011-02-051-2/+2
| | | | | Static member variables in MessageDigestHelper class are now functions under message_digest namespace.
* Reverted comment which was removed unintentionally. Moved 2Tatsuhiro Tsujikawa2011-01-161-1/+3
| | | | DownloadEngine related lines outside of #ifdef ENABLE_MESSAGE_DIGEST.
* Eliminated SocketCore::peekData() form HTTP/FTP downloads.Tatsuhiro Tsujikawa2011-01-161-43/+60
| | | | | | | | | | 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.
* Allocate buffer used by DownloadCommand in stack.Tatsuhiro Tsujikawa2010-12-081-7/+6
|
* Renamed DownloadErrorCode.h as error_code.h. RenamedTatsuhiro Tsujikawa2010-11-281-1/+1
| | | | downloaderrorcode::Value as error_code::Value.
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-1/+1
| | | | | | | | Use format specifier %lld for cuid_t. Defined cuid_t as long long int instead of int64_t, since g++ complains int64_t is not suitable for %lld.
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-7/+6
| | | | | | Replaced StringFormat with fmt
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-15/+12
| | | | | | | Rewritten Logger interface. Logger now writes source file name and line number in log file.
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-2/+1
| | | | | | | | | 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-3/+3
| | | | | | | | 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-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced MessageDigestContext with MessageDigest. Cleaned up unnecessary functions in MessageDigestHelper. * src/BtPieceMessage.cc * src/Checksum.h * src/DHTTokenTracker.cc * src/DownloadCommand.cc * src/DownloadCommand.h * src/HashFuncEntry.h * src/IteratableChecksumValidator.cc * src/IteratableChecksumValidator.h * src/IteratableChunkChecksumValidator.cc * src/IteratableChunkChecksumValidator.h * src/LibgcryptMessageDigestImpl.cc * src/LibgcryptMessageDigestImpl.h * src/LibsslMessageDigestImpl.cc * src/LibsslMessageDigestImpl.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/MessageDigest.cc * src/MessageDigest.h * src/MessageDigestHelper.cc * src/MessageDigestHelper.h * src/MessageDigestImpl.h * src/MetalinkParserController.cc * src/Piece.cc * src/Piece.h * src/UTMetadataDataExtensionMessage.cc * src/bittorrent_helper.cc * src/messageDigest.cc: Removed * src/messageDigest.h: Removed * src/util.cc * src/version_usage.cc * test/BittorrentHelperTest.cc * test/GZipDecoderTest.cc * test/GZipDecodingStreamFilterTest.cc * test/IteratableChecksumValidatorTest.cc * test/IteratableChunkChecksumValidatorTest.cc * test/Makefile.am * test/MessageDigestHelperTest.cc * test/MessageDigestTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkProcessorTest.cc * test/PieceTest.cc * test/TestUtil.cc * test/TestUtil.h * test/UTMetadataDataExtensionMessageTest.cc * test/UTMetadataPostDownloadHandlerTest.cc
* 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed compiler warning about printf format. * src/AdaptiveURISelector.cc * src/BtPieceMessage.cc * src/DHTAbstractNodeLookupTask.h * src/DHTMessageFactoryImpl.cc * src/DHTPeerLookupTask.cc * src/DHTReplaceNodeTask.cc * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtMessageDispatcher.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtRequestFactory.cc * src/DefaultExtensionMessageFactory.cc * src/DefaultPieceStorage.cc * src/DownloadCommand.cc * src/FileAllocationCommand.cc * src/FileEntry.cc * src/HandshakeExtensionMessage.cc * src/IteratableChunkChecksumValidator.cc * src/LibgcryptDHKeyExchange.h * src/LibsslDHKeyExchange.h * src/LpdDispatchMessageCommand.cc * src/MSEHandshake.cc * src/MessageDigestHelper.cc * src/MultiDiskAdaptor.cc * src/PeerConnection.cc * src/SegmentMan.cc * src/TimedHaltCommand.cc * src/UTMetadataRequestExtensionMessage.cc * src/UTPexExtensionMessage.cc * src/bencode2.cc * src/bittorrent_helper.cc * src/message.h
* 2010-09-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-231-3/+3
| | | | | | | Made small optimization. * src/DownloadCommand.cc
* 2010-09-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-2/+2
| | | | | | | Fixed compile error without OpenSSL/GnuTLS. * src/DownloadCommand.cc
* 2010-09-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-4/+2
| | | | | | | | | Fixed compile error without BitTorrent support and OpenSSL/GnuTLS. * src/DownloadCommand.cc * src/DownloadCommand.h * src/RequestGroup.cc