Parcourir la source

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 il y a 12 ans
Parent
commit
07d38e31ad
1 fichiers modifiés avec 4 ajouts et 5 suppressions
  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;