fixed bug where local peer discovery and DHT wouldn't be announced to without trackers

This commit is contained in:
Arvid Norberg 2010-06-17 17:01:28 +00:00
parent 93bdc61410
commit 19df3dbc2f
2 changed files with 4 additions and 4 deletions

View File

@ -32,6 +32,7 @@
incoming connection incoming connection
* added more detailed instrumentation of the disk I/O thread * 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 * fixed bug in bdecoder when decoding invalid messages
* added build warning when building with UNICODE but the standard library * added build warning when building with UNICODE but the standard library
doesn't provide std::wstring doesn't provide std::wstring

View File

@ -449,7 +449,7 @@ namespace libtorrent
else else
{ {
set_state(torrent_status::downloading_metadata); 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) if (settings().prefer_udp_trackers)
prioritize_udp_trackers(); prioritize_udp_trackers();
if (!m_trackers.empty()) start_announcing(); if (!m_trackers.empty()) announce_with_tracker();
else stop_announcing();
} }
void torrent::prioritize_udp_trackers() void torrent::prioritize_udp_trackers()
@ -3128,7 +3127,7 @@ namespace libtorrent
if (k - m_trackers.begin() < m_last_working_tracker) ++m_last_working_tracker; if (k - m_trackers.begin() < m_last_working_tracker) ++m_last_working_tracker;
k = m_trackers.insert(k, url); k = m_trackers.insert(k, url);
if (k->source == 0) k->source = announce_entry::source_client; 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) bool torrent::choke_peer(peer_connection& c)