Selaa lähdekoodia

Don't search faster server using ServerStatMan if req_ is null or
total length is unknown.

Tatsuhiro Tsujikawa 14 vuotta sitten
vanhempi
commit
d2e76eca47
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      src/AbstractCommand.cc

+ 3 - 2
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;