Move URI to spendUris_ when it is selected in

FileEntry::findFasterRequest().
pull/1/head
Tatsuhiro Tsujikawa 2011-06-28 22:38:31 +09:00
parent bd4d3a27b3
commit 45430983d8
1 changed files with 5 additions and 2 deletions

View File

@ -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;