added support for compact=1

This commit is contained in:
Arvid Norberg
2004-03-12 16:42:33 +00:00
parent d6dc5b52e4
commit f4cc9f755f
2 changed files with 38 additions and 4 deletions

View File

@@ -486,8 +486,17 @@ namespace libtorrent
++i)
{
peer_connection* c = i->connection;
// ignore peers that are choked or
// whose connection is closed
if (c == 0) continue;
if (c->is_choked()) continue;
// if we still owe this peer some upload
// don't choke it
if (c->share_diff() > 0) continue;
// select the one that has been waiting
// for an unchoke the longest
if (last_unchoke > i->last_optimistically_unchoked) continue;
last_unchoke = i->last_optimistically_unchoked;
candidate = &(*i);