mirror of https://github.com/aria2/aria2
Save URI returned only from FileEntry::getRemainingUris()
The currently used URIs are inserted back into remaining URI list in FileEntry::putBackRequest(), which overlaps to some of the URIs in spentUris_. If we save spent URIs, each time save is performed, the number of URIs are increased due to this overlap. This change fixes this bug.pull/73/head
parent
b874c7df11
commit
07d38e31ad
|
@ -173,13 +173,12 @@ bool writeDownloadResult
|
|||
return true;
|
||||
}
|
||||
const SharedHandle<FileEntry>& file = dr->fileEntries[0];
|
||||
std::vector<std::string> uris;
|
||||
file->getUris(uris);
|
||||
if(uris.empty()) {
|
||||
if(file->getRemainingUris().empty()) {
|
||||
return true;
|
||||
}
|
||||
for(std::vector<std::string>::const_iterator i = uris.begin(),
|
||||
eoi = uris.end(); i != eoi; ++i) {
|
||||
for(std::deque<std::string>::const_iterator i =
|
||||
file->getRemainingUris().begin(),
|
||||
eoi = file->getRemainingUris().end(); i != eoi; ++i) {
|
||||
if (fp.write((*i).c_str(), (*i).size()) != (*i).size() ||
|
||||
fp.write("\t", 1) != 1) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue