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/TimedHaltCommand.h | |
| 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/TimedHaltCommand.h')
| -rw-r--r-- | src/TimedHaltCommand.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/TimedHaltCommand.h b/src/TimedHaltCommand.h new file mode 100644 index 00000000..099e6d73 --- /dev/null +++ b/src/TimedHaltCommand.h @@ -0,0 +1,55 @@ +/* <!-- copyright */ +/* + * aria2 - The high speed download utility + * + * Copyright (C) 2006 Tatsuhiro Tsujikawa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * In addition, as a special exception, the copyright holders give + * permission to link the code of portions of this program with the + * OpenSSL library under certain conditions as described in each + * individual source file, and distribute linked combinations + * including the two. + * You must obey the GNU General Public License in all respects + * for all of the code used other than OpenSSL. If you modify + * file(s) with this exception, you may extend this exception to your + * version of the file(s), but you are not obligated to do so. If you + * do not wish to do so, delete this exception statement from your + * version. If you delete this exception statement from all source + * files in the program, then also delete it here. + */ +/* copyright --> */ +#ifndef _D_TIMED_HALT_COMMAND_H_ +#define _D_TIMED_HALT_COMMAND_H_ + +#include "TimeBasedCommand.h" + +namespace aria2 { + +class TimedHaltCommand:public TimeBasedCommand { +public: + TimedHaltCommand(int32_t cuid, DownloadEngine* e, int32_t secondsToHalt); + + virtual ~TimedHaltCommand(); + + virtual void preProcess(); + + virtual void process(); +}; + +} // namespace aria2 + +#endif // _D_TIMED_HALT_COMMAND_H_ |
