diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 19f848539..69281857d 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -464,7 +464,7 @@ void print_peer_info(std::string& out, std::vector const& { bool unchoked = (i->flags & peer_info::choked) == 0; - snprintf(str, sizeof(str), " %s %s %s" + snprintf(str, sizeof(str), " %s %s" , add_suffix(i->remote_dl_rate, "/s").c_str() , unchoked ? add_suffix(i->estimated_reciprocation_rate, "/s").c_str() : " "); out += str; diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 090e97eee..27558bcba 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1086,6 +1086,16 @@ namespace aux { m_unchoke_time_scaler = 0; } + if (m_settings.local_service_announce_interval != s.local_service_announce_interval) + { + error_code ec; + int delay = (std::max)(s.local_service_announce_interval + / (std::max)(int(m_torrents.size()), 1), 1); + m_lsd_announce_timer.expires_from_now(seconds(delay), ec); + m_lsd_announce_timer.async_wait( + bind(&session_impl::on_lsd_announce, this, _1)); + } + // if queuing settings were changed, recalculate // queued torrents sooner if ((m_settings.active_downloads != s.active_downloads @@ -2189,6 +2199,7 @@ namespace aux { if (e) return; mutex::scoped_lock l(m_mutex); + if (m_abort) return; // announce on local network every 5 minutes int delay = (std::max)(m_settings.local_service_announce_interval @@ -2198,7 +2209,8 @@ namespace aux { m_lsd_announce_timer.async_wait( bind(&session_impl::on_lsd_announce, this, _1)); - if (m_next_lsd_torrent == m_torrents.end()) return; + if (m_next_lsd_torrent == m_torrents.end()) + m_next_lsd_torrent = m_torrents.begin(); m_next_lsd_torrent->second->lsd_announce(); ++m_next_lsd_torrent; if (m_next_lsd_torrent == m_torrents.end()) diff --git a/src/udp_tracker_connection.cpp b/src/udp_tracker_connection.cpp index 6f1f43504..6f6d5dd5d 100644 --- a/src/udp_tracker_connection.cpp +++ b/src/udp_tracker_connection.cpp @@ -295,8 +295,8 @@ namespace libtorrent if (cb) { char msg[200]; - snprintf(msg, 200, "*** UDP_TRACKER_RESPONSE [ tid: %x%x ]" - , int(transaction >> 32), int(transaction & 0xffffffff)); + snprintf(msg, 200, "*** UDP_TRACKER_RESPONSE [ tid: %x ]" + , int(transaction)); cb->debug_log(msg); } #endif