set the peer write state properly when stalled on disk

This commit is contained in:
Arvid Norberg 2010-04-16 19:14:30 +00:00
parent d341343e35
commit 17b4cb027c
1 changed files with 23 additions and 18 deletions

View File

@ -4181,7 +4181,8 @@ namespace libtorrent
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();
@ -4261,8 +4262,11 @@ namespace libtorrent
m_channel_state[upload_channel] = peer_info::bw_network;
}
else if (m_reading_bytes > 0
&& quota_left > 0
&& !m_connecting
&& quota_left > 0)
{
m_channel_state[upload_channel] = peer_info::bw_disk;
if (!m_connecting
&& !m_requests.empty()
&& m_reading_bytes > m_ses.settings().send_buffer_watermark - 0x4000)
{
@ -4283,6 +4287,7 @@ namespace libtorrent
}
}
}
}
void peer_connection::setup_receive()
{