minor streaming improvements

This commit is contained in:
Arvid Norberg 2014-06-08 21:15:34 +00:00
parent aa85d3c35c
commit e291ab3290
2 changed files with 6 additions and 2 deletions

View File

@ -995,8 +995,7 @@ namespace libtorrent
else
{
// current download rate in bytes per seconds
rate = m_statistics.transfer_rate(stat::download_payload)
+ m_statistics.transfer_rate(stat::download_protocol);
rate = m_statistics.transfer_rate(stat::download_payload);
}
// avoid division by zero

View File

@ -8793,6 +8793,11 @@ namespace libtorrent
, boost::bind(&peer_connection::download_queue_time, _1, 16*1024)
< boost::bind(&peer_connection::download_queue_time, _2, 16*1024));
}
// if this peer's download time exceeds 2 seconds, we're done.
// We don't want to build unreasonably long request queues
if (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000))
break;
}
// commit all the time critical requests