summaryrefslogtreecommitdiff
path: root/src/TrackerWatcherCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-06-18 09:23:25 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-06-18 09:23:25 +0000
commit70ff0c0b3b10e5b58714757a3b6aa55e2569c511 (patch)
treee98b35d8d62e0e31d3b87ec92d792a805dcc9e05 /src/TrackerWatcherCommand.cc
parentd380b7b6abe016dd0334b18972ce08a4fa92a934 (diff)
2006-06-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/TorrentMan.cc (setupInternal1): Fixed peerId generation bug. * src/SimpleLogger.h (writeHeader): New function. * src/SimpleLogger.cc (writeHeader): New function. (writeLog): Fixed the bug that causes segfaults if exception message contains an unescaped "%" character. * src/TrackerWatcherCommand.cc (execute): Added a short sleep when a tracker request fails. * src/Request.cc (parseUrl): Query string is now handled properly.
Diffstat (limited to 'src/TrackerWatcherCommand.cc')
-rw-r--r--src/TrackerWatcherCommand.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/TrackerWatcherCommand.cc b/src/TrackerWatcherCommand.cc
index a4875114..4ad394e6 100644
--- a/src/TrackerWatcherCommand.cc
+++ b/src/TrackerWatcherCommand.cc
@@ -22,6 +22,8 @@
#include "TrackerWatcherCommand.h"
#include "InitiateConnectionCommandFactory.h"
#include "Util.h"
+#include "SleepCommand.h"
+#include "prefs.h"
TrackerWatcherCommand::TrackerWatcherCommand(int cuid,
TorrentDownloadEngine* e,
@@ -35,6 +37,11 @@ bool TrackerWatcherCommand::execute() {
// we assume the tracker request has failed.
e->torrentMan->trackers = 0;
e->segmentMan->init();
+ // sleep a few seconds.
+ SleepCommand* sleepCommand =
+ new SleepCommand(cuid, e, this, e->option->getAsInt(PREF_RETRY_WAIT));
+ e->commands.push_back(sleepCommand);
+ return false;
}
if(e->torrentMan->trackers == 0 &&
(e->torrentMan->connections < MAX_PEER_UPDATE ||