diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-04-11 22:45:37 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-04-11 22:45:37 +0900 |
| commit | 07d38e31adb7a01a002b0a844a47f5f8ee4fe875 (patch) | |
| tree | a2e95ad1ac4bd280fbc6137179e5b273a1b86172 | |
| parent | b874c7df11f5f4a5407fb91ebef8f6b12dfd47f4 (diff) | |
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.
| -rw-r--r-- | src/SessionSerializer.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc index d3d16f09..990b8ef5 100644 --- a/src/SessionSerializer.cc +++ b/src/SessionSerializer.cc @@ -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; |
