fix bug in web and http seeds shutdown
This commit is contained in:
@@ -90,8 +90,6 @@ namespace libtorrent
|
|||||||
, policy::peer* peerinfo);
|
, policy::peer* peerinfo);
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
~http_seed_connection();
|
|
||||||
|
|
||||||
virtual int type() const { return peer_connection::http_seed_connection; }
|
virtual int type() const { return peer_connection::http_seed_connection; }
|
||||||
|
|
||||||
// called from the main loop when this connection has any
|
// 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 void get_specific_peer_info(peer_info& p) const;
|
||||||
virtual bool in_handshake() const;
|
virtual bool in_handshake() const;
|
||||||
|
virtual void disconnect(error_code const& ec, int error = 0);
|
||||||
|
|
||||||
// the following functions appends messages
|
// the following functions appends messages
|
||||||
// to the send buffer
|
// to the send buffer
|
||||||
|
@@ -329,7 +329,7 @@ namespace libtorrent
|
|||||||
|
|
||||||
void on_timeout();
|
void on_timeout();
|
||||||
// this will cause this peer_connection to be disconnected.
|
// 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; }
|
bool is_disconnecting() const { return m_disconnecting; }
|
||||||
|
|
||||||
// this is called when the connection attempt has succeeded
|
// this is called when the connection attempt has succeeded
|
||||||
|
@@ -88,8 +88,6 @@ namespace libtorrent
|
|||||||
, policy::peer* peerinfo);
|
, policy::peer* peerinfo);
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
~web_peer_connection();
|
|
||||||
|
|
||||||
virtual int type() const { return peer_connection::url_seed_connection; }
|
virtual int type() const { return peer_connection::url_seed_connection; }
|
||||||
|
|
||||||
// called from the main loop when this connection has any
|
// 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 void get_specific_peer_info(peer_info& p) const;
|
||||||
virtual bool in_handshake() const;
|
virtual bool in_handshake() const;
|
||||||
|
virtual void disconnect(error_code const& ec, int error = 0);
|
||||||
|
|
||||||
// the following functions appends messages
|
// the following functions appends messages
|
||||||
// to the send buffer
|
// to the send buffer
|
||||||
|
@@ -113,9 +113,11 @@ namespace libtorrent
|
|||||||
peer_connection::start();
|
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();
|
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);
|
if (t) t->disconnect_web_seed(m_url, web_seed_entry::http_seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -118,9 +118,11 @@ namespace libtorrent
|
|||||||
peer_connection::start();
|
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();
|
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);
|
if (t) t->disconnect_web_seed(m_original_url, web_seed_entry::url_seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user