summaryrefslogtreecommitdiff
path: root/src/UnknownLengthPieceStorage.h
Commit message (Collapse)AuthorAgeFilesLines
* flush internal buffers before auto-saving control fileAli MJ Al-Nasrawy2020-06-171-1/+1
| | | | | | | | | | 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>
* UnknownLengthPieceStorage: return piece lengthkwkam2017-11-081-5/+1
| | | | | show something in console status when downloading items with unknown content length
* spelling fixesklemens2017-03-201-1/+1
|
* Fix some compiler warningsNils Maier2016-07-191-0/+2
|
* Change have entry indexing methodTatsuhiro Tsujikawa2016-07-101-17/+9
| | | | Now use increasing sequence of integer rather than timer value.
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-85/+75
|
* Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-1/+3
|
* Show bitfield for unknown length download in aria2.tellStatus RPC methodTatsuhiro Tsujikawa2014-07-151-8/+8
| | | | | | | | | Generally, bitfield is not available for download whose total length is unknown. We create bitfield when download is completed (usually connection EOF) so that we can use it to show additional info in RPC aria2.tellStatus response. Specifically, bitfield is now shown. And completedLength under files key (or completedLength in aria2.getFiles() response) is correctly shown.
* Convert most 0/NULL pointers to nullptrNils Maier2013-08-201-2/+2
| | | | Courtesy of llvm cpp11-migrate 3.3
* Use CXX11_OVERRIDETatsuhiro Tsujikawa2013-07-061-49/+57
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-27/+27
|
* Hygiene: Fix some clang warnings, mostly unused private members.Nils Maier2013-03-011-4/+1
|
* Added --disk-cache optionTatsuhiro Tsujikawa2012-12-031-0/+4
| | | | | | | | | | 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 trailing spacesTatsuhiro Tsujikawa2012-10-011-5/+5
|
* Removed *Handle typedefTatsuhiro Tsujikawa2012-09-281-2/+0
|
* Use int64_t instead of off_tTatsuhiro Tsujikawa2012-06-251-6/+6
| | | | | 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-6/+6
| | | | | 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/+2
| | | | | | In DefaultPieceStorage::onDownloadIncomplete(), we call StreamPieceSelector::onBitfieldInit(). Added GeomStreamPieceSelectorTest.
* Managed user cuid in Piece.Tatsuhiro Tsujikawa2011-07-161-9/+20
| | | | | | Previous implementation does not store information which Command cuid uses which Piece. Mark Piece acquired by SegmentMan by setting Piece::setUsedBySegment(true).
* Added StreamPieceSelector class.Tatsuhiro Tsujikawa2011-06-111-1/+1
| | | | | This class abstracts the piece selection algorithm for HTTP/FTP download.
* 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-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-08-291-25/+6
| | | | | | | | | | | | Removed getMissingFastPiece(piece) and getMissingFastPiece(piece, excludedIndexes) from PieceStorage. Done some code cleanup. * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-08-291-0/+22
| | | | | | | | | | | | | | | | Added a sets of overloaded functions for PieceStorage::getMissingPiece() and getMissingFastPiece() to get multiple pieces more efficiently. * src/DefaultBtInteractive.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/DefaultPieceStorageTest.cc * test/MockPieceStorage.h
* 2010-08-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-08-261-0/+2
| | | | | | | | | | | | | Enter end game mode as soon as all pieces are assigned to peer to avoid substantial slow down at the very last stage of download. * src/DefaultBtInteractive.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Pass maxSplitSize as an argument, instead of member variable of DefaultPieceStorage. SegmentMan::getSegment(cuid_t,size_t index) was renamed to SegmentMan::getSegmentWithIndex(...) * src/AbstractCommand.cc * src/AbstractCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/PieceStorage.h * src/RequestGroup.cc * src/SegmentMan.cc * src/SegmentMan.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h * test/SegmentManTest.cc
* 2010-07-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-07-121-0/+1
| | | | | | | | | | | | | | | | | | | Set end byte in Range header if start byte > 0 to get more chance to pool socket. * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/HttpDownloadCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/PieceStorage.h * src/UnknownLengthPieceStorage.h * test/DefaultPieceStorageTest.cc * test/HttpRequestTest.cc * test/MockPieceStorage.h
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-11/+11
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-04-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-111-1/+1
| | | | | | | | Use clock_gettime(CLOCK_MONOTONIC, ...) if it is available and usable to prevent from aria2 from being affected by system time change.
* 2010-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-201-2/+2
| | | | | | Use cuid_t type for cuid.
* 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-281-5/+6
| | | | | | | Use vector instead of deque for containers which is used for mostly read-only purpose.
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-8/+8
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-12-051-2/+2
| | | | | | | | | | | | | | Fixed compile error if ENABLE_BITTORRENT is undefined. * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h * test/ProtocolDetectorTest.cc * test/XmlRpcMethodTest.cc
* 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-11-221-0/+2
| | | | | | | | | | Added setEndGamePieceNum() pure virtual function to PieceStorage. * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2009-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-11-201-0/+2
| | | | | | | | | | | | | | Fixed the bug that slow server is not knocked down in favor of faster one. * src/AbstractCommand.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added experimental support of WEB-Seeding for multi-file torrent. Due to fundamental changes in file handling in HTTP/FTP code, many functions are not working: PeerStat, ServerHost, proxy..etc * src/AbstractCommand.cc * src/AbstractCommand.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/CreateRequestCommand.cc * src/CreateRequestCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h * src/FtpDownloadCommand.cc * src/FtpDownloadCommand.h * src/FtpFinishDownloadCommand.cc * src/FtpFinishDownloadCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.h * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/FtpTunnelResponseCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.h * src/HttpProxyResponseCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/InitiateConnectionCommandFactory.cc * src/InitiateConnectionCommandFactory.h * src/Makefile.am * src/PieceStorage.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/SegmentMan.cc * src/SegmentMan.h * src/SingleFileDownloadContext.h * src/StreamFileAllocationEntry.cc * src/TrackerWatcherCommand.cc * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * src/array_fun.h * src/bitfield.h * src/download_helper.cc * test/DownloadContextTest.cc * test/Makefile.am * test/MockDownloadContext.h
* 2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-05-291-0/+4
| | | | | | | | | | | | | | | Removed Peer.cc from compile source list when --disable-bittorrent is specified. Added #ifdef ENABLE_BITTORRENT guard to methods that takes Peer. * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/Makefile.am * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-05-121-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Selecting files are now done in DefaultBtContext::setFileFileter(). PieceStorage::setFileFilter(), DiskAdaptor::addDownloadEntry() functions are removed because they are no longer used. Creating filter in BitfieldMan is done in new funtion PieceStorage::setupFileFilter() * src/BtContext.cc * src/BtContext.h * src/DefaultBtContext.cc * src/DefaultBtContext.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/PieceStorage.h * src/RequestGroup.cc * src/UnknownLengthPieceStorage.h * src/XmlRpcMethodImpl.cc * test/DefaultBtContextTest.cc * test/MockBtContext.h * test/MockPieceStorage.h
* 2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-191-0/+6
| | | | | | | | | | | | | | | | | | | | | Fixed the bug that a block in a piece is requested when same block is already requested to the same peer in end game mode. * src/BtRequestFactory.h * src/DefaultBtInteractive.cc * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/DefaultBtRequestFactoryTest.cc * test/DefaultPieceStorageTest.cc * test/MockBtRequestFactory.h * test/MockPieceStorage.h
* 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-111-1/+1
| | | | | | | | | | | | | | | Changed method signature: PieceStorage::getInFlightPieces * src/DefaultBtProgressInfoFile.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * test/DefaultBtProgressInfoFileTest.cc * test/MockPieceStorage.h
* 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-111-5/+4
| | | | | | | | | | | | | Changed method signature: PieceStorage::getAdvertisedPieceIndexes * src/DefaultBtInteractive.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PieceStorage.h * src/UnknownLengthPieceStorage.h * test/MockPieceStorage.h
* 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-111-0/+13
| | | | | | | | | | | | | | | | | | Implemented rarest piece first piece selection strategy. * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtBitfieldMessage.cc * src/BtHaveAllMessage.cc * src/BtHaveMessage.cc * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/PeerInteractionCommand.cc * src/PieceStorage.h * src/UnknownLengthPieceStorage.h
* 2008-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-151-22/+7
| | | | | | | Fixed compilation error with g++-4.3
* 2008-03-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-081-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type clarification: size_t for length or size, uint64_t for file length, off_t for file offset. * src/PiecedSegment.cc * src/GrowSegment.h * src/DefaultBtRequestFactory.h * src/DefaultBtProgressInfoFile.cc * src/UnknownLengthPieceStorage.h * src/DefaultPieceStorage.cc * src/UnknownLengthPieceStorage.cc * src/DefaultBtInteractive.cc * src/GrowSegment.cc * src/BitfieldMan.h * src/DownloadCommand.cc * src/BtRequestFactory.h * src/PiecedSegment.h * src/DefaultPieceStorage.h * src/Piece.cc * src/DefaultBtRequestFactory.cc * src/PieceStorage.h * src/Segment.h * src/Piece.h * src/BitfieldMan.cc * src/Util.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultPieceStorageTest.cc * test/MockPieceStorage.h * test/BtRequestMessageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/BitfieldManTest.cc * test/GrowSegmentTest.cc * test/PieceTest.cc * test/SegmentTest.cc * test/SegmentManTest.cc * test/DefaultBtRequestFactoryTest.cc * test/MockBtRequestFactory.h
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-24/+25
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
* 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-231-2/+2
| | | | | | | Removed 'extern' from 'extern typedef ...' in src/*.h
* 2007-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preallocate non-requested file which is adjacent forward to requested file('requested' files means the files given in --select-file option) if they share a same piece. This fixes long pause in the file system which doesn't support sparse files like FAT32 while downloading. * src/MultiFileAllocationIterator.{h, cc} * test/MultiFileAllocationIteratorTest.cc * src/FileEntry.{h, cc} Removed unused _option. * src/MultiDiskAdaptor.h * test/MultiDiskAdaptorTest.cc * src/DefaultPieceStorage.cc Set the default value of --seed-ratio to 1.0. If 0.0 is given, then seeding continues regardless of share ratio. * src/version_usage.cc * src/option_processing.cc * src/BtSetup.cc * doc/aria2c.1.txt * doc/aria2c.1 Fixed: Selective download is not working in BitTorrent * src/RequestGroup.cc Introduced Sequence class. Use this instead of Util::unfoldRange() * src/PieceStorage.h * test/MockPieceStorage.h * src/UnknownLengthPieceStorage.h * src/DefaultPieceStorage.{h, cc} * src/Metalink2RequestGroup.cc * src/RequestGroup.cc * src/Sequence.h * test/SequenceTest.cc * src/IntSequence.h * src/message.h * src/Util.{h, cc} * test/UtilTest.cc Added new function 'parse' to catch exception thrown by subclass's parseArg * src/OptionHandler.h * src/OptionParser.cc * src/NameMatchOptionHandler.h * src/OptionHandlerImpl.h * test/OptionHandlerTest.cc Added IntegerRangeOptionHandler. Used for --listen-port and --select-file. Now --listen-port accepts range of port. * src/OptionHandlerFactory.cc * src/version_usage.cc * src/OptionHandlerImpl.h * src/option_processing.cc * src/BtSetup.cc * src/PeerListenCommand.{h, cc} * doc/aria2c.1.txt * doc/aria2c.1 Implemented operator< for Exception class to provide easy way to print exception stack trace. * src/Exception.{h, cc} * src/main.cc * src/option_processing.cc
* 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-111-0/+272
Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.