Merge pull request #605 from ssiloti/RC_1_1

allow peers to resume allocating disk buffers when their last outstan…
This commit is contained in:
Arvid Norberg 2016-04-09 21:33:23 -04:00
commit 5bf8012cb4
1 changed files with 9 additions and 0 deletions

View File

@ -2993,6 +2993,15 @@ namespace libtorrent
TORRENT_ASSERT(m_outstanding_writing_bytes >= 0);
// every peer is entitled to allocate a disk buffer if it has no writes outstanding
// see the comment in incoming_piece
if (m_outstanding_writing_bytes == 0
&& m_channel_state[download_channel] & peer_info::bw_disk)
{
m_counters.inc_stats_counter(counters::num_peers_down_disk, -1);
m_channel_state[download_channel] &= ~peer_info::bw_disk;
}
// flush send buffer at the end of
// this burst of disk events
// m_ses.cork_burst(this);