From 70ff0c0b3b10e5b58714757a3b6aa55e2569c511 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 18 Jun 2006 09:23:25 +0000 Subject: 2006-06-18 Tatsuhiro Tsujikawa * 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. --- src/TrackerWatcherCommand.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/TrackerWatcherCommand.cc') 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 || -- cgit