mirror of https://github.com/aria2/aria2
2009-07-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In a single file download, file size becomes known just after downloading, set total length to FileEntry object when download completed. * src/DownloadCommand.ccpull/1/head
parent
e1d63f3aea
commit
1052600862
|
@ -1,3 +1,10 @@
|
||||||
|
2009-07-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
In a single file download, file size becomes known just after
|
||||||
|
downloading, set total length to FileEntry object when download
|
||||||
|
completed.
|
||||||
|
* src/DownloadCommand.cc
|
||||||
|
|
||||||
2009-07-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-07-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Use std::vector::reserve() for fileEntries and pieceHashes in
|
Use std::vector::reserve() for fileEntries and pieceHashes in
|
||||||
|
|
|
@ -260,6 +260,17 @@ void DownloadCommand::checkLowestDownloadSpeed() const
|
||||||
|
|
||||||
bool DownloadCommand::prepareForNextSegment() {
|
bool DownloadCommand::prepareForNextSegment() {
|
||||||
if(_requestGroup->downloadFinished()) {
|
if(_requestGroup->downloadFinished()) {
|
||||||
|
// If this is a single file download, and file size becomes known
|
||||||
|
// just after downloading, set total length to FileEntry object
|
||||||
|
// here.
|
||||||
|
if(_requestGroup->getDownloadContext()->getFileEntries().size() == 1) {
|
||||||
|
const SharedHandle<FileEntry>& fileEntry =
|
||||||
|
_requestGroup->getDownloadContext()->getFirstFileEntry();
|
||||||
|
if(fileEntry->getLength() == 0) {
|
||||||
|
fileEntry->setLength
|
||||||
|
(_requestGroup->getPieceStorage()->getCompletedLength());
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef ENABLE_MESSAGE_DIGEST
|
#ifdef ENABLE_MESSAGE_DIGEST
|
||||||
CheckIntegrityEntryHandle entry(new ChecksumCheckIntegrityEntry(_requestGroup));
|
CheckIntegrityEntryHandle entry(new ChecksumCheckIntegrityEntry(_requestGroup));
|
||||||
if(entry->isValidationReady()) {
|
if(entry->isValidationReady()) {
|
||||||
|
|
Loading…
Reference in New Issue