diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-18 05:13:21 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-18 05:13:21 +0000 |
| commit | 5752a554bff85455ab0c54ed6e982c6bb5807a8b (patch) | |
| tree | 7f7a42c5ae1d6aea983c8694153e0fa499ffa1b2 /src/SleepCommand.cc | |
| parent | 62d3659410d99609c9fa6399c488d4069e1a4272 (diff) | |
* Added Referer support.
* Added referer command-line option.
* Added rety-wait command-line option.
* Fixed formating bug in Exception::setMsg()
Diffstat (limited to 'src/SleepCommand.cc')
| -rw-r--r-- | src/SleepCommand.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SleepCommand.cc b/src/SleepCommand.cc index 7e56419d..82fc6dc5 100644 --- a/src/SleepCommand.cc +++ b/src/SleepCommand.cc @@ -22,10 +22,8 @@ #include "SleepCommand.h" #include "Util.h" -#define WAIT_SEC 5 - -SleepCommand::SleepCommand(int cuid, DownloadEngine* e, Command* nextCommand): - Command(cuid), engine(e), nextCommand(nextCommand) { +SleepCommand::SleepCommand(int cuid, DownloadEngine* e, Command* nextCommand, int wait): + Command(cuid), engine(e), nextCommand(nextCommand), wait(wait) { gettimeofday(&checkPoint, NULL); } @@ -38,7 +36,7 @@ SleepCommand::~SleepCommand() { bool SleepCommand::execute() { struct timeval now; gettimeofday(&now, NULL); - if(Util::difftv(now, checkPoint) >= WAIT_SEC*1000000) { + if(Util::difftv(now, checkPoint) >= wait*1000000) { engine->commands.push(nextCommand); nextCommand = NULL; return true; |
