From 23881fb0ffb6a7a17c9a249a6f960635bcd0157e Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 14 Feb 2010 17:24:53 +0000 Subject: [PATCH] lsd and dht announce timer fixes --- src/session_impl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index b975e0583..c734d3913 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2246,6 +2246,8 @@ namespace aux { m_dht_announce_timer.async_wait( bind(&session_impl::on_dht_announce, this, _1)); + if (m_torrents.empty()) return; + if (m_next_dht_torrent == m_torrents.end()) m_next_dht_torrent = m_torrents.begin(); m_next_dht_torrent->second->dht_announce(); @@ -2270,6 +2272,8 @@ namespace aux { m_lsd_announce_timer.async_wait( bind(&session_impl::on_lsd_announce, this, _1)); + if (m_torrents.empty()) return; + if (m_next_lsd_torrent == m_torrents.end()) m_next_lsd_torrent = m_torrents.begin(); m_next_lsd_torrent->second->lsd_announce();