diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-11 05:07:08 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-11 05:07:08 +0000 |
| commit | 9c277148b9cd1c3ddfc4a2e126d64a230c608255 (patch) | |
| tree | 8589671cadf1a72fdc52ecc9dfb8d55e699fc3ac /src/FillRequestGroupCommand.cc | |
| parent | 5d6f1c046a9220a8e45d127f12c463a167479872 (diff) | |
2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to stop aria2 itself when given time has
passed
from start. Use --stop option to specify time in minutes.
When 0 is given, this feature is disabled.
* src/OptionHandlerFactory.cc
* src/TimeBasedCommand.h: Make _interval protected scope.
* src/HelpItemFactory.cc
* src/option_processing.cc
* src/prefs.h
* src/FillRequestGroupCommand.cc: Evaluate _e->isHaltRequested()
before calling RequestGroupMan::fillRequestGroupFromReserver().
Without this modification, the result list shows "ERR" when
aria2 is
stopped by --stop option. It should be "INPR".
* src/DownloadEngine.{h, cc}
* src/DownloadEngineFactory.cc
* src/usage_text.h
* src/TimedHaltCommand.{h, cc}: New class.
Diffstat (limited to 'src/FillRequestGroupCommand.cc')
| -rw-r--r-- | src/FillRequestGroupCommand.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 4256b869..0fa2f8ab 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -56,13 +56,16 @@ FillRequestGroupCommand::~FillRequestGroupCommand() {} bool FillRequestGroupCommand::execute() { + if(_e->isHaltRequested()) { + return true; + } try { _e->_requestGroupMan->fillRequestGroupFromReserver(_e); } catch(RecoverableException* ex) { logger->error(EX_EXCEPTION_CAUGHT, ex); delete ex; } - if(_e->_requestGroupMan->downloadFinished() || _e->isHaltRequested()) { + if(_e->_requestGroupMan->downloadFinished()) { return true; } _e->commands.push_back(this); |
