summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-29 21:30:32 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-29 21:30:32 +0900
commitd2e76eca4720da4a205e8450f9b7a2c85969b757 (patch)
treec8588df56a23f952c60e96d74ff7c5a4cf9fc684 /src/AbstractCommand.cc
parent644bb4e8173d69eb198108bf969128424b8ddac1 (diff)
Don't search faster server using ServerStatMan if req_ is null or
total length is unknown.
Diffstat (limited to 'src/AbstractCommand.cc')
-rw-r--r--src/AbstractCommand.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc
index d85d7ac1..16f5f004 100644
--- a/src/AbstractCommand.cc
+++ b/src/AbstractCommand.cc
@@ -180,8 +180,9 @@ bool AbstractCommand::execute() {
}
}
// Don't use this feature if PREF_MAX_{OVERALL_}DOWNLOAD_LIMIT
- // is used
- if(e_->getRequestGroupMan()->getMaxOverallDownloadSpeedLimit() == 0 &&
+ // is used or total length is unknown.
+ if(req_ && fileEntry_->getLength() > 0 &&
+ e_->getRequestGroupMan()->getMaxOverallDownloadSpeedLimit() == 0 &&
requestGroup_->getMaxDownloadSpeedLimit() == 0 &&
serverStatTimer_.difference(global::wallclock) >= 10) {
serverStatTimer_ = global::wallclock;