forked from premiere/premiere-libtorrent
fixed connection setup and teardown issues
This commit is contained in:
parent
b85727c633
commit
ec80a85bdb
|
@ -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<torrent> 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<performance_alert>())
|
||||
if (m_ses.m_alerts.should_post<performance_alert>())
|
||||
{
|
||||
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<torrent> t = m_torrent.lock();
|
||||
|
|
Loading…
Reference in New Issue