Pārlūkot izejas kodu

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.
Tatsuhiro Tsujikawa 12 gadi atpakaļ
vecāks
revīzija
07d38e31ad
1 mainītis faili ar 4 papildinājumiem un 5 dzēšanām
  1. 4 5
      src/SessionSerializer.cc

+ 4 - 5
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;