2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Prefer untested server in FeedbackURISelector
	* src/FeedbackURISelector.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-07-15 11:48:32 +00:00
parent 86222984cb
commit 1984c2a542
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Prefer untested server in FeedbackURISelector
* src/FeedbackURISelector.cc
2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Documented --min-split-size option in man page. Documented --min-split-size option in man page.

View File

@ -100,13 +100,18 @@ std::string FeedbackURISelector::selectInternal
} }
SharedHandle<ServerStat> ss = SharedHandle<ServerStat> ss =
serverStatMan_->find(r.getHost(), r.getProtocol()); serverStatMan_->find(r.getHost(), r.getProtocol());
if(!ss.isNull() && ss->isOK() && ss->getDownloadSpeed() > SPEED_THRESHOLD) { // We prefer untested one.
fastCands.push_back(std::make_pair(ss, *i)); if(ss.isNull()) {
return *i;
} }
if(ss.isNull() || ss->isOK()) { if(ss->isOK()) {
if(ss->getDownloadSpeed() > SPEED_THRESHOLD) {
fastCands.push_back(std::make_pair(ss, *i));
} else {
normCands.push_back(*i); normCands.push_back(*i);
} }
} }
}
if(fastCands.empty()) { if(fastCands.empty()) {
if(normCands.empty()) { if(normCands.empty()) {
if(usedHosts.empty()) { if(usedHosts.empty()) {