fix to previous check-in

This commit is contained in:
Arvid Norberg 2007-04-11 17:44:15 +00:00
parent 109cc3f232
commit e503e334d5
3 changed files with 9 additions and 5 deletions

View File

@ -120,6 +120,9 @@ namespace libtorrent
~torrent(); ~torrent();
// starts the announce timer
void start();
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
void add_extension(boost::shared_ptr<torrent_plugin>); void add_extension(boost::shared_ptr<torrent_plugin>);
#endif #endif

View File

@ -1271,6 +1271,7 @@ namespace libtorrent { namespace detail
new torrent(*this, m_checker_impl, ti, save_path new torrent(*this, m_checker_impl, ti, save_path
, m_listen_interface, compact_mode, block_size , m_listen_interface, compact_mode, block_size
, settings(), sc)); , settings(), sc));
torrent_ptr->start();
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin() 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 new torrent(*this, m_checker_impl, tracker_url, info_hash, name
, save_path, m_listen_interface, compact_mode, block_size , save_path, m_listen_interface, compact_mode, block_size
, settings(), sc)); , settings(), sc));
torrent_ptr->start();
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
for (extension_list_t::iterator i = m_extensions.begin() for (extension_list_t::iterator i = m_extensions.begin()

View File

@ -255,13 +255,9 @@ namespace libtorrent
m_connections_quota.max = std::numeric_limits<int>::max(); m_connections_quota.max = std::numeric_limits<int>::max();
m_policy.reset(new policy(this)); m_policy.reset(new policy(this));
init(); init();
boost::weak_ptr<torrent> 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( torrent::torrent(
session_impl& ses session_impl& ses
, aux::checker_impl& checker , aux::checker_impl& checker
@ -343,7 +339,10 @@ namespace libtorrent
} }
m_policy.reset(new policy(this)); m_policy.reset(new policy(this));
}
void torrent::start()
{
boost::weak_ptr<torrent> self(shared_from_this()); boost::weak_ptr<torrent> self(shared_from_this());
m_announce_timer.expires_from_now(seconds(1)); m_announce_timer.expires_from_now(seconds(1));
m_announce_timer.async_wait(m_ses.m_strand.wrap( m_announce_timer.async_wait(m_ses.m_strand.wrap(