summaryrefslogtreecommitdiff
path: root/src/RequestGroupMan.h
Commit message (Collapse)AuthorAgeFilesLines
* Add --keep-unfinished-download-result optionTatsuhiro Tsujikawa2016-09-241-0/+10
| | | | | | | | | This option keeps unfinished download results even if doing so exceeds --max-download-result. This is useful if all unfinished downloads must be saved in session file (see --save-session option). Please keep in mind that there is no upper bound to the number of unfinished download result to keep. User should use this option only when they know the total number of downloads in advance.
* Added support for a dynamic management of the number of concurrent downloads ↵oliviercommelarbre2016-03-161-3/+18
| | | | as a function of the overall bandwidth observed
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-96/+52
|
* Rewrite Time with chronoTatsuhiro Tsujikawa2015-06-091-1/+1
|
* Add --bt-detach-seed-only optionTatsuhiro Tsujikawa2014-10-141-0/+9
| | | | | | | | | | 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.
* Use std::make_shared and make_unique where possible, part 2Tatsuhiro Tsujikawa2014-09-131-2/+2
|
* Fix use-after-free on exit with multi-file torrent download + DHTTatsuhiro Tsujikawa2014-06-081-12/+7
| | | | | | | | | | | DefaultPieceStorage may be referenced by one of DHT task (e.g., DHTPeerLookupTask), after RequestGroup was deleted, and even after RequestGroupMan was deleted. DefaultPieceStorage has a reference to MultiDiskAdaptor which calls RequestGroupMan object on destruction. So when DHT task is destroyed, DefaultPieceStorage is destroyed, which in turn destroys MultiDiskAdaptor. DHT task is destroyed after RequestGroupMan was destroyed, MultiDiskAdaptor will use now freed RequestGroupMan object, this is use-after-free.
* Save session only when there is change since the last serializationTatsuhiro Tsujikawa2014-05-311-0/+13
| | | | | | | | | | | | | This is a slight optimization not to cause useless disk access. This only applies to saving session automatically (see --save-session-interval). aria2.saveSession and serialization at the end of the session are always performed as before. When serialization, we first check that whether there is any change since the last serialization. To do this, we first calculate hash value of serialized content without writing into file. Then compare this value to the value of last serialization. If they do not match, perform serialization.
* Revert "Save session only when there is change since the last serialization"Tatsuhiro Tsujikawa2014-05-311-15/+0
| | | | This reverts commit 1944d8db58555c08b5f069a2e987fcfdd5aad997.
* Save session only when there is change since the last serializationTatsuhiro Tsujikawa2014-05-301-0/+15
| | | | | | | This is a slight optimization not to cause useless disk access. This only applies to saving session automatically (see --save-session-interval). aria2.saveSession and serialization at the end of the session are always performed as before.
* Add numStoppedTotal key to aria2.getGlobalStat() RPC method responseTatsuhiro Tsujikawa2014-02-151-0/+9
| | | | | | | It shows the number of stopped downloads in the current session and not capped by --max-download-result option. On the other hand, the existing numStopped key also shows the number of stopped downloads, but it is capped by --max-download-result option.
* Fix bug that numOpenFile_ is not reduced when MultiDiskAdaptor is deletedTatsuhiro Tsujikawa2013-12-311-0/+2
| | | | This bug caused assertion error in RequestGroupMan::ensureMaxOpenFileLimit
* Limit number of opened file globally with --bt-max-open-files optionTatsuhiro Tsujikawa2013-11-171-0/+11
| | | | | | | | | | This change changes the behavior of --bt-max-open-files. Previously, it specifies the maximum number of opened files for each multi-file download. Since it is more useful to limit the number globally, the option now specifies the global limit. This change suggests that aria2.changeOption() method now ignores --bt-max-open-files and aria2.changeGlobalOption now reads it and dynamically change the limit.
* Move RequestGroup vector from Context to RequestGroupManTatsuhiro Tsujikawa2013-06-231-1/+1
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-24/+24
|
* Add changePosition APITatsuhiro Tsujikawa2013-05-151-1/+1
|
* Fix event polling not working with no downloads but keepRunning_ is trueTatsuhiro Tsujikawa2013-05-021-0/+5
|
* Add sessionConfigSetKeepRunning and shutdown API functionTatsuhiro Tsujikawa2013-05-011-2/+8
| | | | | | Setting sessionConfigSetKeepRunning to true makes aria2 core keep running even if there is no download to perform, just like --enable-rpc option.
* Use IndexedList::remove_if to clean up RequestGroupMan::removeStoppedGroupTatsuhiro Tsujikawa2013-03-031-2/+0
|
* Hygiene: Fix some clang warnings, mostly unused private members.Nils Maier2013-03-011-7/+1
|
* Faster deletion of RequestGroup and DownloadResult listsTatsuhiro Tsujikawa2012-12-191-32/+16
|
* Use map to make DownloadResult lookup fastTatsuhiro Tsujikawa2012-12-161-0/+6
|
* Added --disk-cache optionTatsuhiro Tsujikawa2012-12-031-0/+12
| | | | | | | | | | 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/+8
| | | | | | | | | | | | | | 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 *Handle typedefTatsuhiro Tsujikawa2012-09-281-4/+2
|
* Use const char* instead of static const std::stringTatsuhiro Tsujikawa2012-09-241-2/+2
|
* Add GID => RequestGroup index for faster access to RequestGroupTatsuhiro Tsujikawa2012-07-311-0/+18
|
* Removed tailing whitespacesTatsuhiro Tsujikawa2012-07-311-3/+3
|
* Added --deferred-input option.Tatsuhiro Tsujikawa2012-02-051-0/+6
| | | | | | | | | If true is given to --deferred-input option, aria2 does not read all URIs and options from file specified by -i option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If false is given, aria2 reads all URIs and options at startup. This option defaults to false.
* Use int or int32_t instead of size_t where suitableTatsuhiro Tsujikawa2011-12-091-14/+14
|
* Use int instead of unsigned int where unsigned int is not needed.Tatsuhiro Tsujikawa2011-12-091-9/+9
|
* Made --max-download-result option available in aria2.changeGlobalOption.Tatsuhiro Tsujikawa2011-10-221-0/+5
|
* Added --download-result option.Tatsuhiro Tsujikawa2011-08-221-1/+6
| | | | | | | | | | Added --download-result=OPT option. This option changes the way "Download Results" is formatted. If OPT is 'default', print GID, status, average download speed and path/URI. If multiple files are involved, path/URI of first requested file is printed and remaining ones are omitted. If OPT is 'full', print GID, status, average download speed, percentage of progress and path/URI. The percentage of progress and path/URI are printed for each requested file in each row.
* Use global::cout to output string to stdout.Tatsuhiro Tsujikawa2011-08-091-5/+5
| | | | | | | In MinGW32 build, global::cout is WinConsoleFile. When outputing to console, it uses WriteConsoleW, so Unicode characters are written. Fixed memory leak in WChar<->MultiByte conversion functions. The portion of code which uses std::cout is rewritten to use global::cout.
* Use ServerStat to find faster server.Tatsuhiro Tsujikawa2011-06-281-0/+5
|
* Don't save removed download in --save-session text file.Tatsuhiro Tsujikawa2011-05-291-0/+3
| | | | | Now stat column of removed downloads in Download Results is 'RM' instead of INPR.
* Replaced gid_t with a2_gid_t cause gid_t is commonly used as group ID.Tatsuhiro Tsujikawa2011-03-171-6/+6
|
* Deprecated --enable-xml-rpc and --xml-rpc-* option. IntroducedTatsuhiro Tsujikawa2011-03-141-2/+2
| | | | | | | --enable-rpc and --rpc-* option instead. --enable-xml-rpc and --xml-rpc-* option can be used but warning message will be shown. The help tag #xml-rpc was replaced with #rpc.
* Added aria2.removeDownloadResult XML-RPC method.Tatsuhiro Tsujikawa2011-01-201-0/+4
| | | | | | The method signature is aria2.removeDownloadResult(gid). This method removes completed/error/removed download denoted by gid from memory. This method returns "OK" for success.
* 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-2/+0
| | | | | | | 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-0/+2
| | | | | | | | | 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-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-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-101-0/+11
| | | | | | | | | | | | | | | | | | | | | Added --max-download-result=NUM option. This option sets maximum number of download result kept in memory. The download results are completed/error/ removed downloads. The download results are stored in FIFO queue and it can store at most NUM download results. When queue is full and new download result is created, oldest download result is removed from the front of the queue and new one is pushed to the back. Setting big number in this option may result high memory consumption after thousands of downloads. Specifying 0 means no download result is kept. Default value is 1000. * src/OptionHandlerFactory.cc * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/prefs.cc * src/prefs.h * src/usage_text.h
* 2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | FeedbackURISelector now tries to select URI whose host is least used in aria2 globally. Reverted the previous change. * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/CreateRequestCommand.cc * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/URISelector.h * src/a2algo.h * test/FeedbackURISelectorTest.cc * test/InOrderURISelectorTest.cc
* 2010-07-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-141-0/+2
| | | | | | | | | | | | | | | | | | | | | FeedbackURISelector now tries to chooses URI which is not used in aria2 globally. If it is possible, it may return used URI. * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/CreateRequestCommand.cc * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/URISelector.h * test/FeedbackURISelectorTest.cc * test/InOrderURISelectorTest.cc
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-40/+40
| | | | | | | 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-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-201-7/+6
| | | | | | | | | | | | | | Use gid_t type for gid. * src/BtRegistry.cc * src/BtRegistry.h * src/DownloadResult.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/XmlRpcMethodImpl.cc
* 2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-051-0/+20
| | | | | | | | | | | | | Only execute RequestGroupMan::fillRequestGroupFromReserver() when queue maintenance is requested by RequestGroup to avoid to call the function unnecessarily. * src/FillRequestGroupCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h