From 3c15535d35d197af87e1fbb201f737f668dda7c8 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 30 Mar 2008 19:00:37 +0000 Subject: [PATCH] http_tracker_connection fix to use separate timeout when stopping a tracker --- src/http_tracker_connection.cpp | 6 +++++- src/tracker_manager.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index ff79f31af..547c6a7dd 100755 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -167,7 +167,11 @@ namespace libtorrent m_tracker_connection.reset(new http_connection(ios, cc , boost::bind(&http_tracker_connection::on_response, self(), _1, _2, _3, _4))); - m_tracker_connection->get(url, seconds(stn.tracker_completion_timeout) + int timeout = req.event==tracker_request::stopped + ?stn.stop_tracker_timeout + :stn.tracker_completion_timeout; + + m_tracker_connection->get(url, seconds(timeout) , 1, &ps, 5, stn.user_agent, bind_infc); #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) diff --git a/src/tracker_manager.cpp b/src/tracker_manager.cpp index 3a2b137da..9dda723bb 100755 --- a/src/tracker_manager.cpp +++ b/src/tracker_manager.cpp @@ -335,6 +335,11 @@ exit: } // close will remove the entry from m_connections // so no need to pop + +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING + boost::shared_ptr rc = c->requester(); + if (rc) rc->debug_log("aborting: " + req.url); +#endif c->close(); }