fix bug in web and http seeds shutdown

This commit is contained in:
Arvid Norberg 2010-04-09 05:51:31 +00:00
parent ef35360722
commit c26d1631e0
5 changed files with 9 additions and 7 deletions

View File

@ -90,8 +90,6 @@ namespace libtorrent
, policy::peer* peerinfo);
void start();
~http_seed_connection();
virtual int type() const { return peer_connection::http_seed_connection; }
// called from the main loop when this connection has any
@ -105,6 +103,7 @@ namespace libtorrent
virtual void get_specific_peer_info(peer_info& p) const;
virtual bool in_handshake() const;
virtual void disconnect(error_code const& ec, int error = 0);
// the following functions appends messages
// to the send buffer

View File

@ -329,7 +329,7 @@ namespace libtorrent
void on_timeout();
// this will cause this peer_connection to be disconnected.
void disconnect(error_code const& ec, int error = 0);
virtual void disconnect(error_code const& ec, int error = 0);
bool is_disconnecting() const { return m_disconnecting; }
// this is called when the connection attempt has succeeded

View File

@ -88,8 +88,6 @@ namespace libtorrent
, policy::peer* peerinfo);
void start();
~web_peer_connection();
virtual int type() const { return peer_connection::url_seed_connection; }
// called from the main loop when this connection has any
@ -103,6 +101,7 @@ namespace libtorrent
virtual void get_specific_peer_info(peer_info& p) const;
virtual bool in_handshake() const;
virtual void disconnect(error_code const& ec, int error = 0);
// the following functions appends messages
// to the send buffer

View File

@ -113,9 +113,11 @@ namespace libtorrent
peer_connection::start();
}
http_seed_connection::~http_seed_connection()
void http_seed_connection::disconnect(error_code const& ec, int error)
{
boost::shared_ptr<torrent> t = associated_torrent().lock();
TORRENT_ASSERT(t);
peer_connection::disconnect(ec, error);
if (t) t->disconnect_web_seed(m_url, web_seed_entry::http_seed);
}

View File

@ -118,9 +118,11 @@ namespace libtorrent
peer_connection::start();
}
web_peer_connection::~web_peer_connection()
void web_peer_connection::disconnect(error_code const& ec, int error)
{
boost::shared_ptr<torrent> t = associated_torrent().lock();
TORRENT_ASSERT(t);
peer_connection::disconnect(ec, error);
if (t) t->disconnect_web_seed(m_original_url, web_seed_entry::url_seed);
}