From 19df3dbc2ffddb0a63eb019a1ea122d1eb30889a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 17 Jun 2010 17:01:28 +0000 Subject: [PATCH] fixed bug where local peer discovery and DHT wouldn't be announced to without trackers --- ChangeLog | 1 + src/torrent.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61f737680..58cfb1a04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fixed bug where local peer discovery and DHT wouldn't be announced to without trackers * fixed bug in bdecoder when decoding invalid messages * added build warning when building with UNICODE but the standard library doesn't provide std::wstring diff --git a/src/torrent.cpp b/src/torrent.cpp index 72ca9e9e2..c096dd3b8 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -449,7 +449,7 @@ namespace libtorrent else { set_state(torrent_status::downloading_metadata); - if (!m_trackers.empty()) start_announcing(); + start_announcing(); } } @@ -3078,8 +3078,7 @@ namespace libtorrent if (settings().prefer_udp_trackers) prioritize_udp_trackers(); - if (!m_trackers.empty()) start_announcing(); - else stop_announcing(); + if (!m_trackers.empty()) announce_with_tracker(); } void torrent::prioritize_udp_trackers() @@ -3128,7 +3127,7 @@ namespace libtorrent if (k - m_trackers.begin() < m_last_working_tracker) ++m_last_working_tracker; k = m_trackers.insert(k, url); if (k->source == 0) k->source = announce_entry::source_client; - if (!m_trackers.empty()) start_announcing(); + if (!m_trackers.empty()) announce_with_tracker(); } bool torrent::choke_peer(peer_connection& c)