mirror of https://github.com/aria2/aria2
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.hpull/1/head
parent
4c694b9585
commit
730f7449ae
|
@ -1,3 +1,12 @@
|
|||
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
|
||||
|
||||
2010-04-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Possible fix for chunked encoding with Content-Length.
|
||||
|
|
|
@ -241,6 +241,12 @@ void DownloadEngine::requestHalt()
|
|||
_requestGroupMan->halt();
|
||||
}
|
||||
|
||||
void DownloadEngine::requestForceHalt()
|
||||
{
|
||||
_haltRequested = true;
|
||||
_requestGroupMan->forceHalt();
|
||||
}
|
||||
|
||||
void DownloadEngine::setStatCalc(const StatCalcHandle& statCalc)
|
||||
{
|
||||
_statCalc = statCalc;
|
||||
|
|
|
@ -196,6 +196,8 @@ public:
|
|||
|
||||
void requestHalt();
|
||||
|
||||
void requestForceHalt();
|
||||
|
||||
void setNoWait(bool b);
|
||||
|
||||
void addRoutineCommand(Command* command);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,11 @@
|
|||
namespace aria2 {
|
||||
|
||||
class TimedHaltCommand:public TimeBasedCommand {
|
||||
private:
|
||||
bool _forceHalt;
|
||||
public:
|
||||
TimedHaltCommand(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt);
|
||||
TimedHaltCommand
|
||||
(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt, bool forceHalt=false);
|
||||
|
||||
virtual ~TimedHaltCommand();
|
||||
|
||||
|
|
Loading…
Reference in New Issue