mirror of
https://github.com/aria2/aria2.git
synced 2024-11-27 08:00:23 +00:00
2f4b3f7d02
To add the ability to download multi torrent into respective files directly: * src/DiskWriter.h (openFile): New function. (seek): Removed. * src/MultiDiskWriter.h: New class. * src/MultiDiskWriter.cc: New class. * src/AbstractDiskWriter.h (seek): Changed its scope from public to protected. (openFile): New function. * src/AbstractDiskWriter.cc (openFile): New function. * src/prefs.h (V_FALSE): New definition. (PREF_DIRECT_FILE_MAPPING): New definition. * src/TorrentMan.h (setupDiskWriter): New function. (setAllMultiFileRequestedState): New function. (onDownloadComplete): New function. * src/TorrentMan.cc : Included MultiDiskWriter.h (setupDiskWriter): New function. (getFilePath): Updated. (getTempFilePath): Updated. (getSegmentFilePath): Updated. (fixFilename): Updated. (deleteTempFile): Updated. (setAllMultiFileRequestedState): New function. (setFileEntriesToDownload): Use setAllMultiFileRequestedState(). (finishPartialDownloadingMode): Reset requested flags. (onDownloadComplete): New function. * src/main.cc: Added --direct-file-mapping option. Use TorretMan::setupDiskWriter(). * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan:: onDownloadComplete(). To fix ETA bug: * src/Util.h (difftvsec): New function. * src/Util.cc (difftvsec): New function. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the type of "elapsed" instead of long long int. (calculateStatistics): Use Util::difftvsec instead of Util::difftv. The updates of statistics takes place every 1 seconds. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type. (calculateSpeed): Changed its argument signature. * src/PeerMessage.cc (toString): Fixed message.
1 line
7 B
Plaintext
1 line
7 B
Plaintext
FGHIJKL |