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>
|
2010-04-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Possible fix for chunked encoding with Content-Length.
|
Possible fix for chunked encoding with Content-Length.
|
||||||
|
|
|
@ -241,6 +241,12 @@ void DownloadEngine::requestHalt()
|
||||||
_requestGroupMan->halt();
|
_requestGroupMan->halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DownloadEngine::requestForceHalt()
|
||||||
|
{
|
||||||
|
_haltRequested = true;
|
||||||
|
_requestGroupMan->forceHalt();
|
||||||
|
}
|
||||||
|
|
||||||
void DownloadEngine::setStatCalc(const StatCalcHandle& statCalc)
|
void DownloadEngine::setStatCalc(const StatCalcHandle& statCalc)
|
||||||
{
|
{
|
||||||
_statCalc = statCalc;
|
_statCalc = statCalc;
|
||||||
|
|
|
@ -196,6 +196,8 @@ public:
|
||||||
|
|
||||||
void requestHalt();
|
void requestHalt();
|
||||||
|
|
||||||
|
void requestForceHalt();
|
||||||
|
|
||||||
void setNoWait(bool b);
|
void setNoWait(bool b);
|
||||||
|
|
||||||
void addRoutineCommand(Command* command);
|
void addRoutineCommand(Command* command);
|
||||||
|
|
|
@ -42,8 +42,10 @@
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e,
|
TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e,
|
||||||
time_t secondsToHalt):
|
time_t secondsToHalt,
|
||||||
TimeBasedCommand(cuid, e, secondsToHalt, true) {}
|
bool forceHalt):
|
||||||
|
TimeBasedCommand(cuid, e, secondsToHalt, true),
|
||||||
|
_forceHalt(forceHalt) {}
|
||||||
|
|
||||||
TimedHaltCommand::~TimedHaltCommand() {}
|
TimedHaltCommand::~TimedHaltCommand() {}
|
||||||
|
|
||||||
|
@ -58,8 +60,13 @@ void TimedHaltCommand::process()
|
||||||
{
|
{
|
||||||
if(!_e->isHaltRequested()) {
|
if(!_e->isHaltRequested()) {
|
||||||
logger->notice(MSG_TIME_HAS_PASSED, _interval);
|
logger->notice(MSG_TIME_HAS_PASSED, _interval);
|
||||||
|
if(_forceHalt) {
|
||||||
|
_e->requestForceHalt();
|
||||||
|
} else {
|
||||||
_e->requestHalt();
|
_e->requestHalt();
|
||||||
}
|
}
|
||||||
|
_exit = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -40,8 +40,11 @@
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
class TimedHaltCommand:public TimeBasedCommand {
|
class TimedHaltCommand:public TimeBasedCommand {
|
||||||
|
private:
|
||||||
|
bool _forceHalt;
|
||||||
public:
|
public:
|
||||||
TimedHaltCommand(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt);
|
TimedHaltCommand
|
||||||
|
(cuid_t cuid, DownloadEngine* e, time_t secondsToHalt, bool forceHalt=false);
|
||||||
|
|
||||||
virtual ~TimedHaltCommand();
|
virtual ~TimedHaltCommand();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue