summaryrefslogtreecommitdiff
path: root/src/RequestGroup.h
Commit message (Collapse)AuthorAgeFilesLines
* Better auto-renamingNils Maier2016-07-191-2/+2
| | | | | | | | | | | | | | | | | | Up until now aria2 file auto renaming worked by just appending a new unique number to the file path, behind the file name extension, if any, changing what most other programs consider the file extension in the process. Now, aria2 will attempt to insert the number before the file extension, leaving the extension intact, so that e.g. a ".jpg" still is a ".jpg" file and opens in your configured image viewer when clicking it. If a file has no extension (incl. so called "dot files"), the number will be appended to the file name as usual. Note: This is a potentially breaking change that might break third party scripts that rely on aria2 auto file renaming producing a certain format for renamed files. Please fix your scripts accordingly. Closes GH-709
* Restart active download to apply previously not applicable optionsTatsuhiro Tsujikawa2016-05-061-0/+18
| | | | | | | | | | | | | | | Previously, we categorized options that can be used in aria2.changeOption RPC method into 2 categories. The options in one category can be applied on the fly, meaning that download continues to be active while applying options. Another category includes options which are only applicable when downloads are waiting or paused. In this change, when active download is ordered to change options which only applicable in waiting or paused state, it is now paused, and then automatically restarted. Although we have limited number of download concurrency, the pause and restart is done atomically, and the download is inserted at the front of the queue, it is picked up immediately if the concurrency regulation allows.
* Add following to aria2.tellStatus response key as reverse link for followedByTatsuhiro Tsujikawa2016-03-051-0/+8
|
* Add "seeder" key to tellStatus RPC responseTatsuhiro Tsujikawa2016-02-031-0/+3
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-133/+50
|
* Send the last error message as part of tellStatus RPC responseJarda Snajdr2015-11-181-2/+6
|
* Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-6/+3
|
* Add --bt-detach-seed-only optionTatsuhiro Tsujikawa2014-10-141-0/+8
| | | | | | | | | | This option excludes seed only downloads when counting concurrent active downloads (-j option). This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode, then it is excluded from active download count (thus it becomes 2), and the next download waiting in queue gets started. But be aware that seeding item is still recognized as active download in RPC method.
* Revert to existing "proper" coding styleTatsuhiro Tsujikawa2014-06-031-8/+8
| | | | | The rule is simple: don't try to change the coding style of the existing codebase.
* Cleanup AbstractCommand take 2Nils Maier2014-05-291-0/+5
| | | | | | Decided to keep the 'if(' -> 'if (' stuff, as I formatted the whole file and so it is internally consistent within the file. Also, too much hassle.
* Revert "Cleanup AbstractCommand"Nils Maier2014-05-291-5/+0
| | | | This reverts commit 0465aa54557e802156d1df0661c29d2aadb5541d.
* Cleanup AbstractCommandNils Maier2014-05-271-0/+5
| | | | | | | In my quest to explore the code and understand it, why not clean it up in the progress. Most formatting provided by clang-format. ;) Aside from formatting, also extracted some method and unnested some control structs.
* Stuff memory holesNils Maier2013-12-091-45/+47
| | | | | | | | | | | | | | | | | | 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
* Refactor DownloadHandlerFactoryTatsuhiro Tsujikawa2013-11-101-4/+4
|
* Don't fail multiple concurrent dl same file if auto-file-renaming is enabledTatsuhiro Tsujikawa2013-11-081-1/+1
|
* Cleanup RequestGroup code a bitNils Maier2013-09-201-10/+10
|
* Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntryTatsuhiro Tsujikawa2013-07-061-2/+2
|
* Use std::unique_ptr for URISelector instead of std::shared_ptrTatsuhiro Tsujikawa2013-07-041-3/+3
|
* Wrap Command object in std::unique_ptrTatsuhiro Tsujikawa2013-06-231-8/+11
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-39/+39
|
* Save gid option with --save-session optionTatsuhiro Tsujikawa2012-12-171-0/+5
|
* Use 64 bits random bytes as GIDTatsuhiro Tsujikawa2012-12-161-11/+5
| | | | | | | | | | 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.
* Reworked download/upload statistics calculationTatsuhiro Tsujikawa2012-10-251-0/+5
| | | | | | | | | | | | | | 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.
* Removed trailing spacesTatsuhiro Tsujikawa2012-10-011-1/+1
|
* Rewritten DownloadHandlerConstantsTatsuhiro Tsujikawa2012-09-221-22/+0
| | | | | | | | | | 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.
* Add GID => RequestGroup index for faster access to RequestGroupTatsuhiro Tsujikawa2012-07-311-0/+18
|
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-5/+5
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* Use PRId64 for int64_t format specifierTatsuhiro Tsujikawa2012-06-251-2/+1
|
* aria2 now doesn't assume download's completed just because file size matchedTatsuhiro Tsujikawa2012-01-081-1/+2
| | | | | | | | 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.
* Use int instead of unsigned int where unsigned int is not needed.Tatsuhiro Tsujikawa2011-12-091-16/+16
|
* Replaced uint64_t with off_t or int64_t.Tatsuhiro Tsujikawa2011-12-091-5/+5
| | | | | 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-1/+2
|
* Don't copy Option in RequestGroup ctor.Tatsuhiro Tsujikawa2011-10-251-1/+0
| | | | Copy on receive is not a practice in aria2 source code.
* Eliminated few seconds delay when downloads stop or pause.Tatsuhiro Tsujikawa2011-05-151-0/+5
| | | | | | | | | | | | | | | | The delay is caused because some Commands are only called in certain interval(called refreshInterval, default, 1000ms). In aria2 download stops when all Commands associated to it are stopped. Since some Commands are called in each 1000ms by default, as mentioned before, we have to wait for them. To fix this issue, we call DownloadEngine::setRefreshInterval(0) when pausing/stopping downloads. DownloadEngine::setRefreshInterval(0) makes refreshInterval 0 in one shot. When all segments are ignored, now DownloadFailureException is thrown. And stop the download immediately. As described earlier, we call DownloadEngine::setRefreshInterval(0) in catch block of DownloadFailureException to eliminate delay.
* Replaced gid_t with a2_gid_t cause gid_t is commonly used as group ID.Tatsuhiro Tsujikawa2011-03-171-10/+10
|
* Replaced RequestGroup::lastUriResult_ withTatsuhiro Tsujikawa2010-11-281-2/+5
| | | | RequestGroup::lastErrorCode_.
* Renamed DownloadErrorCode.h as error_code.h. RenamedTatsuhiro Tsujikawa2010-11-281-5/+5
| | | | downloaderrorcode::Value as error_code::Value.
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-3/+0
| | | | | | | Rewritten Logger interface. Logger now writes source file name and line number in log file.
* 2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-121-2/+2
| | | | | | | | Removed SharedHandle::isNull(). Instead we added operator* and operator unspecified_bool_type. Removed use of WeakHandle and replaced with raw pointer.
* 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-311-3/+3
| | | | | | Made #include guard consistent for c++ header files.
* 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | 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-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-171-3/+6
| | | | | | | | | | | | | | Count the number of command used in HTTP(S)/FTP and the number of connections in HTTP(S)/FTP independently. The former is used to determin whether additional command is needed. The latter is used to report user to how many connections are used in a download. * src/AbstractCommand.cc * src/AbstractCommand.h * src/CreateRequestCommand.cc * src/RequestGroup.cc * src/RequestGroup.h
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-86/+86
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-131-1/+1
| | | | | | | | | | Made DownloadResult struct * src/DownloadResult.h * src/RequestGroup.h * src/RequestGroupMan.h * src/XmlRpcMethodImpl.h
* 2010-05-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-05-221-1/+1
| | | | | | | | | | | | | | | Added totalLength, completedLength, uploadLength, bitfield, downloadSpeed, uploadSpeed, infoHash, numSeeders, pieceLength, numPieces, connections and dir to the response of aria2.tellStopped XML-RPC method. aria2.tellWaiting now always returns numSeeders for BitTorrent download. * src/DownloadResult.h * src/RequestGroup.cc * src/RequestGroup.h * src/XmlRpcMethodImpl.cc * test/XmlRpcMethodTest.cc
* 2010-04-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-131-0/+2
| | | | | | | | | | Hold reference to PieceStorage when paused in order to provide progress information via XML-RPC. * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc
* 2010-04-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-04-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --save-session=FILE option. This option saves error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with -i option on restart. Please note that downloads added by aria2.addTorrent and aria2.addMetalink XML-RPC method are not saved. * src/BtPostDownloadHandler.cc * src/DownloadResult.h * src/Makefile.am * src/MetadataInfo.cc * src/MetadataInfo.h * src/Metalink2RequestGroup.cc * src/MetalinkPostDownloadHandler.cc * src/MultiUrlRequestInfo.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/SessionSerializer.cc * src/SessionSerializer.h * src/UTMetadataPostDownloadHandler.cc * src/download_helper.cc * src/download_helper.h * src/prefs.cc * src/prefs.h * src/usage_text.h * test/Makefile.am * test/SessionSerializerTest.cc * test/XmlRpcMethodTest.cc * test/serialize_session.meta4
* 2010-03-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --always-resume and --max-resume-failure-tries option. If --always-resume=false is given, when all given URIs does not support resume or aria2 encounters N URIs which does not support resume (N is the value specified using --max-resume-failure-tries option), aria2 download file from scratch. The default behavior is --always-resume=true, which means if all URIs do not support resume, download fails. I think this is OK because user normally don't like to see that partially downloaded file is overwritten(this is particularly true if file size is big). This option is useful when aria2 is used as download backend and graceful falling back to overwritten behavior is preferable. Added exit status value 8, which means download failed because server did not support resume. * src/AbstractCommand.cc * src/DefaultPieceStorage.cc * src/DownloadCommand.cc * src/DownloadResultCode.h * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/RequestGroup.h * src/SegmentMan.cc * src/SegmentMan.h * src/prefs.cc * src/prefs.h * src/usage_text.h * test/DefaultPieceStorageTest.cc * test/SegmentManTest.cc
* 2010-03-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-211-1/+1
| | | | | | | | | | | | | | | | | Defined gid_t as int64_t. * src/BtDependency.cc * src/BtStopDownloadCommand.cc * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/TrackerWatcherCommand.cc * src/XmlRpcMethodImpl.cc * src/message.h * test/XmlRpcMethodTest.cc