瀏覽代碼

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 年之前
父節點
當前提交
07d38e31ad
共有 1 個文件被更改,包括 4 次插入5 次删除
  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;