From e503e334d56412809e3c39751f4a249ab34c5feb Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 11 Apr 2007 17:44:15 +0000 Subject: [PATCH] fix to previous check-in --- include/libtorrent/torrent.hpp | 3 +++ src/session_impl.cpp | 2 ++ src/torrent.cpp | 9 ++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index d59492eee..e2904ca6d 100755 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -120,6 +120,9 @@ namespace libtorrent ~torrent(); + // starts the announce timer + void start(); + #ifndef TORRENT_DISABLE_EXTENSIONS void add_extension(boost::shared_ptr); #endif diff --git a/src/session_impl.cpp b/src/session_impl.cpp index d38775429..38891ec31 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1271,6 +1271,7 @@ namespace libtorrent { namespace detail new torrent(*this, m_checker_impl, ti, save_path , m_listen_interface, compact_mode, block_size , settings(), sc)); + torrent_ptr->start(); #ifndef TORRENT_DISABLE_EXTENSIONS for (extension_list_t::iterator i = m_extensions.begin() @@ -1358,6 +1359,7 @@ namespace libtorrent { namespace detail new torrent(*this, m_checker_impl, tracker_url, info_hash, name , save_path, m_listen_interface, compact_mode, block_size , settings(), sc)); + torrent_ptr->start(); #ifndef TORRENT_DISABLE_EXTENSIONS for (extension_list_t::iterator i = m_extensions.begin() diff --git a/src/torrent.cpp b/src/torrent.cpp index 4a5ba7127..58fce6c87 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -255,13 +255,9 @@ namespace libtorrent m_connections_quota.max = std::numeric_limits::max(); m_policy.reset(new policy(this)); init(); - - boost::weak_ptr self(shared_from_this()); - m_announce_timer.expires_from_now(seconds(1)); - m_announce_timer.async_wait(m_ses.m_strand.wrap( - bind(&torrent::on_announce_disp, self, _1))); } + torrent::torrent( session_impl& ses , aux::checker_impl& checker @@ -343,7 +339,10 @@ namespace libtorrent } m_policy.reset(new policy(this)); + } + void torrent::start() + { boost::weak_ptr self(shared_from_this()); m_announce_timer.expires_from_now(seconds(1)); m_announce_timer.async_wait(m_ses.m_strand.wrap(