From ec80a85bdb5c0698e3c48222716885c0f019cfcf Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 28 Oct 2011 23:34:55 +0000 Subject: [PATCH] fixed connection setup and teardown issues --- src/peer_connection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 3cf07c5d9..c0ff04218 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -4587,6 +4587,8 @@ namespace libtorrent void peer_connection::setup_send() { + if (m_disconnecting) return; + if (m_channel_state[upload_channel] & (peer_info::bw_network | peer_info::bw_limit)) return; shared_ptr t = m_torrent.lock(); @@ -4659,9 +4661,9 @@ namespace libtorrent // upload rate being virtually 0. If m_requests is empty, it doesn't // matter anyway, because we don't have any more requests from the // peer to hang on to the disk - if (t->alerts().should_post()) + if (m_ses.m_alerts.should_post()) { - t->alerts().post_alert(performance_alert(t->get_handle() + m_ses.m_alerts.post_alert(performance_alert(t->get_handle() , performance_alert::send_buffer_watermark_too_low)); } } @@ -4734,6 +4736,7 @@ namespace libtorrent { INVARIANT_CHECK; + if (m_disconnecting) return; if (m_channel_state[download_channel] & (peer_info::bw_network | peer_info::bw_limit)) return; shared_ptr t = m_torrent.lock();