forked from premiere/premiere-libtorrent
set the peer write state properly when stalled on disk
This commit is contained in:
parent
d341343e35
commit
17b4cb027c
|
@ -4181,7 +4181,8 @@ namespace libtorrent
|
||||||
|
|
||||||
void peer_connection::setup_send()
|
void peer_connection::setup_send()
|
||||||
{
|
{
|
||||||
if (m_channel_state[upload_channel] != peer_info::bw_idle) return;
|
if (m_channel_state[upload_channel] != peer_info::bw_idle
|
||||||
|
&& m_channel_state[upload_channel] != peer_info::bw_disk) return;
|
||||||
|
|
||||||
shared_ptr<torrent> t = m_torrent.lock();
|
shared_ptr<torrent> t = m_torrent.lock();
|
||||||
|
|
||||||
|
@ -4261,8 +4262,11 @@ namespace libtorrent
|
||||||
m_channel_state[upload_channel] = peer_info::bw_network;
|
m_channel_state[upload_channel] = peer_info::bw_network;
|
||||||
}
|
}
|
||||||
else if (m_reading_bytes > 0
|
else if (m_reading_bytes > 0
|
||||||
&& quota_left > 0
|
&& quota_left > 0)
|
||||||
&& !m_connecting
|
{
|
||||||
|
m_channel_state[upload_channel] = peer_info::bw_disk;
|
||||||
|
|
||||||
|
if (!m_connecting
|
||||||
&& !m_requests.empty()
|
&& !m_requests.empty()
|
||||||
&& m_reading_bytes > m_ses.settings().send_buffer_watermark - 0x4000)
|
&& m_reading_bytes > m_ses.settings().send_buffer_watermark - 0x4000)
|
||||||
{
|
{
|
||||||
|
@ -4283,6 +4287,7 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void peer_connection::setup_receive()
|
void peer_connection::setup_receive()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue