forked from premiere/premiere-libtorrent
expose the full peer list size through session_status
This commit is contained in:
parent
1b308a0ca8
commit
cd08a61f35
|
@ -918,7 +918,10 @@ int main(int argc, char* argv[])
|
||||||
case 't': poll_interval = atoi(arg); break;
|
case 't': poll_interval = atoi(arg); break;
|
||||||
case 'F': refresh_delay = atoi(arg); break;
|
case 'F': refresh_delay = atoi(arg); break;
|
||||||
case 'H': start_dht = false; --i; break;
|
case 'H': start_dht = false; --i; break;
|
||||||
case 'W': settings.max_peerlist_size = atoi(arg); break;
|
case 'W':
|
||||||
|
settings.max_peerlist_size = atoi(arg);
|
||||||
|
settings.max_paused_peerlist_size = atoi(arg) / 2;
|
||||||
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
{
|
{
|
||||||
FILE* filter = fopen(arg, "r");
|
FILE* filter = fopen(arg, "r");
|
||||||
|
@ -1475,8 +1478,8 @@ int main(int argc, char* argv[])
|
||||||
, cs.queued_bytes);
|
, cs.queued_bytes);
|
||||||
out += str;
|
out += str;
|
||||||
|
|
||||||
snprintf(str, sizeof(str), "==== optimistic unchoke: %d unchoke counter: %d ====\n"
|
snprintf(str, sizeof(str), "==== optimistic unchoke: %d unchoke counter: %d peerlist: %d ====\n"
|
||||||
, sess_stat.optimistic_unchoke_counter, sess_stat.unchoke_counter);
|
, sess_stat.optimistic_unchoke_counter, sess_stat.unchoke_counter, sess_stat.peerlist_size);
|
||||||
out += str;
|
out += str;
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
|
|
|
@ -105,6 +105,8 @@ namespace libtorrent
|
||||||
size_type dht_global_nodes;
|
size_type dht_global_nodes;
|
||||||
std::vector<dht_lookup> active_requests;
|
std::vector<dht_lookup> active_requests;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int peerlist_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3564,6 +3564,15 @@ namespace aux {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int peerlist_size = 0;
|
||||||
|
for (torrent_map::const_iterator i = m_torrents.begin()
|
||||||
|
, end(m_torrents.end()); i != end; ++i)
|
||||||
|
{
|
||||||
|
peerlist_size += i->second->get_policy().num_peers();
|
||||||
|
}
|
||||||
|
|
||||||
|
s.peerlist_size = peerlist_size;
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue