summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-28 22:38:31 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-28 22:38:31 +0900
commit45430983d871b5d82ee01ca1cf0cf9437add4f3a (patch)
tree20b90f40b4bde8b22df3f032160334be4754a36c /src
parentbd4d3a27b330d53cd27fbb01da22904af496fb16 (diff)
Move URI to spendUris_ when it is selected in
FileEntry::findFasterRequest().
Diffstat (limited to 'src')
-rw-r--r--src/FileEntry.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FileEntry.cc b/src/FileEntry.cc
index 861f9808..355883f5 100644
--- a/src/FileEntry.cc
+++ b/src/FileEntry.cc
@@ -271,11 +271,14 @@ FileEntry::findFasterRequest
}
}
if(!fastCands.empty()) {
- A2_LOG_DEBUG("Selected from fastCands");
std::sort(fastCands.begin(), fastCands.end(), ServerStatFaster());
SharedHandle<Request> fastestRequest(new Request());
- fastestRequest->setUri(fastCands.front().second);
+ const std::string& uri = fastCands.front().second;
+ A2_LOG_DEBUG(fmt("Selected %s from fastCands", uri.c_str()));
+ fastestRequest->setUri(uri);
fastestRequest->setReferer(base->getReferer());
+ uris_.erase(std::find(uris_.begin(), uris_.end(), uri));
+ spentUris_.push_back(uri);
inFlightRequests_.push_back(fastestRequest);
lastFasterReplace_ = global::wallclock;
return fastestRequest;