diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-08-14 13:48:31 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-08-14 13:48:31 +0000 |
| commit | 2f14fec78dfc96b88a905621d35f1d726df0791d (patch) | |
| tree | 8eb4dc9cf94f021ccbdf77dca88924c2c9bf4cea /src/DownloadCommand.cc | |
| parent | 43dae4fd916bb35bf7fd8554fc86ce34c3e7a31b (diff) | |
| parent | 7ca1b43eddd1aba1c71a38dfb46b5ac5685b43d0 (diff) | |
Tagging 0.7.0 release of aria2release-0.7.0
Diffstat (limited to 'src/DownloadCommand.cc')
| -rw-r--r-- | src/DownloadCommand.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc index 441b00de..4e948f53 100644 --- a/src/DownloadCommand.cc +++ b/src/DownloadCommand.cc @@ -20,12 +20,14 @@ */ /* copyright --> */ #include "DownloadCommand.h" -#include <sys/time.h> #include "Util.h" #include "DlRetryEx.h" +#include "DlAbortEx.h" #include "HttpInitiateConnectionCommand.h" #include "InitiateConnectionCommandFactory.h" #include "message.h" +#include "prefs.h" +#include <sys/time.h> DownloadCommand::DownloadCommand(int cuid, Request* req, DownloadEngine* e, const SocketHandle& s): @@ -59,6 +61,13 @@ bool DownloadCommand::executeInternal(Segment seg) { seg.speed = (int)((seg.ds-lastSize)/(diff*1.0)); sw.reset(); lastSize = seg.ds; + int lowestLimit = e->option->getAsInt(PREF_LOWEST_SPEED_LIMIT); + if(lowestLimit > 0 && seg.speed <= lowestLimit) { + throw new DlAbortEx("CUID#%d - Too slow Downloading speed: %d <= %d(B/s)", + cuid, + seg.speed, + lowestLimit); + } } if(e->segmentMan->totalSize != 0 && bufSize == 0) { throw new DlRetryEx(EX_GOT_EOF); |
