summaryrefslogtreecommitdiff
path: root/src/DownloadContext.cc
Commit message (Collapse)AuthorAgeFilesLines
* Don't send Accept Metalink header if Metalink is disabledTatsuhiro Tsujikawa2018-11-181-0/+8
|
* Use default where possibleNils Maier2016-08-291-1/+1
|
* Add bittorrent key to aria2.tellStopped statusTatsuhiro Tsujikawa2016-04-171-7/+12
|
* Updating upload size and speed must be done separatelyTatsuhiro Tsujikawa2016-01-051-4/+13
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-71/+80
|
* Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-5/+5
|
* Use std::make_shared and make_unique where possible, part 1Tatsuhiro Tsujikawa2014-09-131-1/+1
|
* util::parseIntSegments: Return SegList<int>Tatsuhiro Tsujikawa2014-06-041-1/+1
|
* DownloadContext, FileEntry: Use move semantics to path parameter in ctorTatsuhiro Tsujikawa2014-06-041-3/+3
|
* Stuff memory holesNils Maier2013-12-091-16/+17
| | | | | | | | | | | | | | | | | | 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
* Convert to autos and ranged loopsNils Maier2013-08-211-10/+7
|
* Convert most 0/NULL pointers to nullptrNils Maier2013-08-201-2/+2
| | | | Courtesy of llvm cpp11-migrate 3.3
* Use std::unique_ptr for Metalink objectsTatsuhiro Tsujikawa2013-07-121-2/+2
|
* Return nullptr directly where std::shared_ptr is expectedTatsuhiro Tsujikawa2013-07-041-2/+2
| | | | | The constructor of std::shared_ptr which takes nullptr is not explicit so we can return nullptr directly.
* Return std::unique_ptr member as const refTatsuhiro Tsujikawa2013-06-261-2/+3
| | | | | Returning raw pointer has a risk that it may be stolen by std::shared_ptr in accident.
* Pass std::unique_ptr by valueTatsuhiro Tsujikawa2013-06-231-1/+1
|
* DownloadContext::attrs_ now holds std::unique_ptrTatsuhiro Tsujikawa2013-06-231-6/+5
| | | | DownloadContext::getAttribute() returns a raw pointer.
* Cleanup a2functional.hTatsuhiro Tsujikawa2013-06-221-1/+3
| | | | | | Remove mem_fun_sh in favor of std::mem_fun. Remove unused functions. Use std::mem_fn instead of mem_fun_sh
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-16/+16
|
* Reworked download/upload statistics calculationTatsuhiro Tsujikawa2012-10-251-10/+24
| | | | | | | | | | | | | | 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.
* Rewritten DownloadHandlerConstantsTatsuhiro Tsujikawa2012-09-221-2/+2
| | | | | | | | | | 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 std::vector instead of std::map for ContextAttribute objectsTatsuhiro Tsujikawa2012-09-221-17/+15
| | | | Now key for ContextAttribute object store is int instead of string.
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-3/+3
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* Use int32_t for piece length instead of size_tTatsuhiro Tsujikawa2011-12-091-1/+1
|
* Replaced uint64_t with off_t or int64_t.Tatsuhiro Tsujikawa2011-12-091-5/+3
| | | | | Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
* Reuse in-flight and pooled URIs when a download is paused.Tatsuhiro Tsujikawa2011-10-311-0/+1
|
* Code cleanupTatsuhiro Tsujikawa2011-10-301-6/+3
|
* sgl.normalize() must be called before DownloadContext::setFileFilter() call.Tatsuhiro Tsujikawa2011-10-301-1/+0
| | | | sgl.normalize() was removed from DownloadContext::setFileFilter().
* Use SegList<int> instead of IntSequence in DownloadContext::setFileFilter()Tatsuhiro Tsujikawa2011-10-291-15/+24
|
* wallclock is now retrieved using global::wallclock() call.Tatsuhiro Tsujikawa2011-08-101-2/+2
| | | | | This is necessary to avoid global variable initialization order problem.
* Consistent naming scheme for hash type and digest for DownloadContext.Tatsuhiro Tsujikawa2011-07-271-16/+9
|
* Added Metalink/HTTP Link and Digest header field parser.Tatsuhiro Tsujikawa2011-07-261-2/+4
|
* Pass the number of requested files as 2nd argument to the command specified inTatsuhiro Tsujikawa2010-12-041-0/+24
| | | | | | --on-download-* hook. As a consequence, first filename is passed as 3rd argument.
* Removed DownloadContext::dir_. Use PREF_DIR value instead.Tatsuhiro Tsujikawa2010-12-031-7/+0
|
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-4/+4
| | | | | | Replaced StringFormat with fmt
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-0/+43
| | | | | | | | | 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-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To match the behavior of friend operator functions in SharedHandle.h to std::tr1::shared_ptr, we intentionally broke these functions and modified code so that our code does not depend on old behavior. * src/AbstractCommand.cc * src/DHTAbstractNodeLookupTask.h * src/DHTBucket.cc * src/DHTMessageReceiver.cc * src/DHTNodeLookupEntry.cc * src/DHTRoutingTable.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadContext.cc * src/EpollEventPoll.cc * src/Event.h * src/HttpConnection.cc * src/KqueueEventPoll.cc * src/MultiDiskAdaptor.cc * src/PeerAbstractCommand.cc * src/PieceStatMan.cc * src/PollEventPoll.cc * src/PortEventPoll.cc * src/SegmentMan.cc * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStatMan.cc * src/SharedHandle.h * src/UnknownLengthPieceStorage.cc * src/a2functional.h * src/option_processing.cc * src/version_usage.cc * test/BNodeTest.cc * test/DHTAnnouncePeerMessageTest.cc * test/DHTBucketTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTIDCloserTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTPingMessageTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultPeerStorageTest.cc * test/SequentialPickerTest.cc * test/SingletonHolderTest.cc
* 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | 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-06-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-221-0/+8
| | | | | | | | | | | | | | | Fixed that bug that when aria2 is stopped before whole hash check(not piece hash check) is done, aria2 reports its file is downloaded successfully. It should report the download is in-progress and next invocation of aria2 should check hash. * src/ChecksumCheckIntegrityEntry.cc * src/DownloadCommand.cc * src/DownloadContext.cc * src/DownloadContext.h * src/RequestGroup.cc * src/RequestGroupMan.cc
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-39/+39
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-201-0/+29
| | | | | | | | | | Moved non-trivial functions to *.cc file * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h
* 2010-06-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-181-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced ValueBase class, which is a replacement of BDE. In this change ValueBase is used instead of BDE except DHT messages, UTMetadata messages and XML-RPC. They'll be replaced in the later commits. DownloadContext::_attrs is now ContextAttribute rather than BDE. * src/ActivePeerConnectionCommand.cc * src/AnnounceList.cc * src/AnnounceList.h * src/BtDependency.cc * src/BtRegistry.cc * src/BtSetup.cc * src/ConsoleStatCalc.cc * src/ContextAttribute.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DownloadContext.cc * src/DownloadContext.h * src/HandshakeExtensionMessage.cc * src/InitiateConnectionCommand.cc * src/LpdReceiveMessageCommand.cc * src/MSEHandshake.cc * src/Makefile.am * src/Makefile.in * src/PeerInteractionCommand.cc * src/PeerListProcessor.h * src/ProtocolDetector.cc * src/RequestGroup.cc * src/RequestGroupMan.cc * src/TorrentAttribute.h * src/TrackerWatcherCommand.cc * src/UTMetadataDataExtensionMessage.cc * src/UTMetadataPostDownloadHandler.cc * src/UTMetadataRequestExtensionMessage.cc * src/ValueBase.cc * src/ValueBase.h * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h * src/bencode2.cc * src/bencode2.h * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/magnet.cc * src/magnet.h * test/AnnounceListTest.cc * test/Bencode2Test.cc * test/BencodeTest.cc * test/BittorrentHelperTest.cc * test/BtDependencyTest.cc * test/BtRegistryTest.cc * test/DefaultBtAnnounceTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/HandshakeExtensionMessageTest.cc * test/MSEHandshakeTest.cc * test/MagnetTest.cc * test/Makefile.am * test/Makefile.in * test/RequestGroupManTest.cc * test/UTMetadataDataExtensionMessageTest.cc * test/UTMetadataPostDownloadHandlerTest.cc * test/UTMetadataRequestExtensionMessageTest.cc * test/ValueBaseTest.cc * test/XmlRpcMethodTest.cc
* 2010-04-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-131-2/+1
| | | | | | | | | Fixed the bug that user specified path is escaped using util::escapePath() where it should not. * src/DownloadContext.cc * src/DownloadContext.h
* 2010-04-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-111-3/+3
| | | | | | | | Use clock_gettime(CLOCK_MONOTONIC, ...) if it is available and usable to prevent from aria2 from being affected by system time change.
* 2010-04-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added aria2.pause and aria2.unpause XML-RPC method. aria2.pause pauses the download denoted by gid. gid is of type string. The status of paused download becomes "paused" and the download is placed on the first position of waiting queue. As long as the status is "paused", the download is not started. To change status to "waiting", use aria2.unpause method. This method returns GID of paused download. aria2.unpause changes the status of the download denoted by gid from "paused" to "waiting". This makes the download eligible to restart. gid is of type string. This method returns GID of unpaused download. * doc/aria2c.1.txt * src/DownloadContext.cc * src/FileEntry.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h * src/prefs.cc * src/prefs.h * src/usage_text.h
* 2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | Added changeUri XML-RPC method. This method removes/adds URIs dynamically. * doc/aria2c.1.txt * src/AbstractCommand.cc * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroupMan.cc * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h * test/FileEntryTest.cc * test/XmlRpcMethodTest.cc
* 2010-03-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-281-2/+3
| | | | | | | | Avoid to calculate end() iterator in each loop. std::deque is particularly slow. Make sure that recalculate end iterator if element is erased during loop.
* 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-281-1/+1
| | | | | | | Use vector instead of deque for containers which is used for mostly read-only purpose.
* 2010-02-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-271-1/+4
| | | | | | | | | | | | | | | | | Replaced null or control characters in file path with '_'. For MinGW32 build, additional characters which is not allowed in Windows kernel are also replaced. util::detectDirTraversal() now returns true if given string contains null or control characters. * src/DownloadContext.cc * src/DownloadContext.h * src/Metalink2RequestGroup.cc * src/MetalinkParserController.cc * src/bittorrent_helper.cc * src/util.cc * src/util.h * test/UtilTest.cc
* 2010-01-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-281-2/+2
| | | | | | | | | | | | Replaced "." with A2STR::DOT_C * src/AbstractCommand.cc * src/Cookie.cc * src/DownloadContext.cc * src/FtpConnection.cc * src/RequestGroup.cc * src/util.cc