fix optimistic unchoke stats gauge

This commit is contained in:
Arvid Norberg 2014-09-22 07:34:10 +00:00
parent d7d498c3a3
commit a6eda97281
2 changed files with 7 additions and 1 deletions

View File

@ -1150,7 +1150,8 @@ namespace libtorrent
}
// this is called whenever a peer connection is closed
void policy::connection_closed(const peer_connection_interface& c, int session_time, torrent_state* state)
void policy::connection_closed(const peer_connection_interface& c
, int session_time, torrent_state* state)
{
TORRENT_ASSERT(is_single_thread());
INVARIANT_CHECK;

View File

@ -5782,7 +5782,12 @@ namespace libtorrent
if (pp)
{
if (pp->optimistically_unchoked)
{
pp->optimistically_unchoked = false;
m_stats_counters.inc_stats_counter(
counters::num_peers_up_unchoked_optimistic, -1);
trigger_optimistic_unchoke();
}
TORRENT_ASSERT(pp->prev_amount_upload == 0);
TORRENT_ASSERT(pp->prev_amount_download == 0);