summaryrefslogtreecommitdiff
path: root/src/DefaultPieceStorage.cc
Commit message (Collapse)AuthorAgeFilesLines
* flush internal buffers before auto-saving control fileAli MJ Al-Nasrawy2020-06-171-2/+4
| | | | | | | | | | Otherwise, some pieces may be marked as finished in the control file though they have not yet been written to the storage file. This should prevent data loss and corruption when resuming downloads after an app crash. Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
* Enable IndentPPDirectivesTatsuhiro Tsujikawa2018-06-091-3/+3
|
* Don't download piece which is filtered out (e.g., --select-file)Tatsuhiro Tsujikawa2016-10-261-1/+6
| | | | | This commit fixes the bug that piece which is not requested by --select-file is downloaded in multi-file WebSeeding.
* Use default where possibleNils Maier2016-08-291-1/+1
|
* Change have entry indexing methodTatsuhiro Tsujikawa2016-07-101-25/+33
| | | | Now use increasing sequence of integer rather than timer value.
* Use std::make_shared for efficiencyTatsuhiro Tsujikawa2016-05-161-2/+2
|
* Merge branch 'master' into random-webseedingTatsuhiro Tsujikawa2016-03-261-244/+227
|\
| * make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-241/+223
| |
* | Merge branch 'master' into random-webseedingTatsuhiro Tsujikawa2015-10-031-24/+12
|\|
| * Use std::shuffle, instead of std::random_shuffleTatsuhiro Tsujikawa2015-06-111-1/+3
| |
| * Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-23/+9
| |
* | Add --stream-piece-selector=randomTatsuhiro Tsujikawa2015-02-141-0/+4
|/
* Add --bt-detach-seed-only optionTatsuhiro Tsujikawa2014-10-141-4/+7
| | | | | | | | | | 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 1Tatsuhiro Tsujikawa2014-09-131-15/+17
|
* Remove ENABLE_MESSAGE_DIGEST, since we got the internal md, alwaysNils Maier2014-04-171-8/+0
|
* Limit number of opened file globally with --bt-max-open-files optionTatsuhiro Tsujikawa2013-11-171-2/+0
| | | | | | | | | | 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.
* More auto-converts by cpp11-migrateNils Maier2013-09-201-1/+1
|
* Convert to autos and ranged loopsNils Maier2013-08-211-27/+20
|
* Convert most 0/NULL pointers to nullptrNils Maier2013-08-201-1/+1
| | | | Courtesy of llvm cpp11-migrate 3.3
* DefaultPieceStorage::initStorage: Clean upTatsuhiro Tsujikawa2013-07-061-4/+4
|
* MultiDiskAdaptor: Use std::unique_ptr for DiskWriterEntry and DiskWriterTatsuhiro Tsujikawa2013-07-061-3/+2
| | | | | MultiFileAllocationIterator is also rewritten so that it does not requre copying DiskWriterEntry objects.
* Return nullptr directly where std::shared_ptr is expectedTatsuhiro Tsujikawa2013-07-041-6/+6
| | | | | The constructor of std::shared_ptr which takes nullptr is not explicit so we can return nullptr directly.
* Use std::unique_ptr for StreamPieceSelector instead of std::shared_ptrTatsuhiro Tsujikawa2013-07-041-3/+6
|
* Use std::unique_ptr for PieceSelector instead of std::shared_ptrTatsuhiro Tsujikawa2013-07-041-1/+12
|
* Use std::unique_ptr instead of array_ptrTatsuhiro Tsujikawa2013-07-031-5/+5
|
* Return std::unique_ptr member as const refTatsuhiro Tsujikawa2013-06-261-2/+1
| | | | | Returning raw pointer has a risk that it may be stolen by std::shared_ptr in accident.
* DownloadContext::attrs_ now holds std::unique_ptrTatsuhiro Tsujikawa2013-06-231-2/+1
| | | | DownloadContext::getAttribute() returns a raw pointer.
* Use std::mem_fn instead of std::mem_funTatsuhiro Tsujikawa2013-06-221-1/+2
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-54/+54
|
* Send HAVE message to the peer which the piece is downloaded fromTatsuhiro Tsujikawa2013-06-131-3/+0
| | | | | | | | Historically, aria2 did not send HAVE message to the peer which the piece is coming from, thinking it is obvious that the peer knows we have the piece. But it is not obvious if one piece is download from more than 1 peers (e.g., end game mode). So it is better to send HAVE to all peers connected.
* Refactor Notifier interface to accept DownloadEventListener interfaceTatsuhiro Tsujikawa2013-05-111-1/+1
| | | | | | | WebSocketSessionMan now implements DownloadEventListener and is added to Notifier. It becomes member variable of DownloadEngine. The event constant for download event is defined in aria2.h so that we can add event callback API later.
* mingw32: Re-open files with read-only mode enabled on seedingTatsuhiro Tsujikawa2012-12-241-0/+11
| | | | | | | On Mingw32 build, if aria2 opens file with GENERIC_WRITE access right, some programs cannot open the file aria2 is seeding. To avoid this situation, re-open files with read-only enabled when seeding is about to begin.
* Added --disk-cache optionTatsuhiro Tsujikawa2012-12-031-1/+35
| | | | | | | | | | 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.
* Removed *Handle typedefTatsuhiro Tsujikawa2012-09-281-8/+8
|
* 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.
* Added new file allocation method called 'trunc'Tatsuhiro Tsujikawa2012-08-121-0/+2
| | | | | | --file-allocation option can now take new value 'trunc'. 'trunc' uses ftruncate() system call or platform-specific counterpart to truncate a file to a specified length.
* Use enum to select file allocation methodTatsuhiro Tsujikawa2012-08-111-1/+1
|
* Don't sum in-flight piece which does not intersect filtered rangesTatsuhiro Tsujikawa2012-06-271-5/+20
| | | | | When calculating completed length, don't sum the completed length of piece which does not intersect filtered ranges.
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-7/+7
| | | | | Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator and ChecksumValidator are left unchanged.
* Use std::set instead of std::deque if the elements are sorted andTatsuhiro Tsujikawa2012-03-231-20/+8
| | | | insertions and deletions are frequent.
* Added JSON-RPC over WebSocket.Tatsuhiro Tsujikawa2012-03-201-0/+5
| | | | Wslay library must be placed under deps/wslay.
* Fixed clang warning and errors.Tatsuhiro Tsujikawa2012-03-011-1/+1
| | | | | | Test for the zero-length array with A2_ARRAY_LEN was commented out since it is only used in unit test code and clang and old gcc 3.4.3 emit error.
* 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-7/+7
| | | | | Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
* Added PieceStorage::onDownloadIncomplete() virtual function.Tatsuhiro Tsujikawa2011-08-241-0/+5
| | | | | | In DefaultPieceStorage::onDownloadIncomplete(), we call StreamPieceSelector::onBitfieldInit(). Added GeomStreamPieceSelectorTest.
* GeomStreamPieceSelector: Made base changeable and added offsetIndexTatsuhiro Tsujikawa2011-08-241-1/+1
| | | | parameter.
* Added geom parameter to --stream-piece-selector option.Tatsuhiro Tsujikawa2011-08-241-4/+5
|
* 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 Piece.Tatsuhiro Tsujikawa2011-07-271-2/+2
|
* Consistent naming scheme for hash type and digest for DownloadContext.Tatsuhiro Tsujikawa2011-07-271-2/+2
|