summaryrefslogtreecommitdiff
path: root/src/TimedHaltCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-04-02 14:23:59 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-04-02 14:23:59 +0000
commit730f7449aefd5537709dcec64a2ef9973a2bc595 (patch)
treea7284a4925c7728720a7351690f0c8d5af0fa4a0 /src/TimedHaltCommand.cc
parent4c694b95854c0849380b30787159d265f2bd1b5e (diff)
2010-04-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added forceHalt argument to TimedHaltCommand. Added requestForceHalt() to DownloadEngine. * src/DownloadEngine.cc * src/DownloadEngine.h * src/TimedHaltCommand.cc * src/TimedHaltCommand.h
Diffstat (limited to 'src/TimedHaltCommand.cc')
-rw-r--r--src/TimedHaltCommand.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/TimedHaltCommand.cc b/src/TimedHaltCommand.cc
index f4ccff1b..25f1deaf 100644
--- a/src/TimedHaltCommand.cc
+++ b/src/TimedHaltCommand.cc
@@ -42,8 +42,10 @@
namespace aria2 {
TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e,
- time_t secondsToHalt):
- TimeBasedCommand(cuid, e, secondsToHalt, true) {}
+ time_t secondsToHalt,
+ bool forceHalt):
+ TimeBasedCommand(cuid, e, secondsToHalt, true),
+ _forceHalt(forceHalt) {}
TimedHaltCommand::~TimedHaltCommand() {}
@@ -58,7 +60,12 @@ void TimedHaltCommand::process()
{
if(!_e->isHaltRequested()) {
logger->notice(MSG_TIME_HAS_PASSED, _interval);
- _e->requestHalt();
+ if(_forceHalt) {
+ _e->requestForceHalt();
+ } else {
+ _e->requestHalt();
+ }
+ _exit = true;
}
}