From: Matt Joiner Date: Wed, 21 May 2014 07:49:59 +0000 (+1000) Subject: Be more selective about when to replenish connection requests X-Git-Tag: v1.0.0~1741 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=cc81bca617dad09727dd2c3feaa1a385de147b2b;p=btrtrc.git Be more selective about when to replenish connection requests --- diff --git a/client.go b/client.go index e697884e..bce8eab2 100644 --- a/client.go +++ b/client.go @@ -395,6 +395,7 @@ func (me *Client) connectionLoop(torrent *torrent, conn *connection) error { case peer_protocol.Unchoke: conn.PeerChoked = false me.peerUnchoked(torrent, conn) + me.replenishConnRequests(torrent, conn) case peer_protocol.Interested: conn.PeerInterested = true // TODO: This should be done from a dedicated unchoking routine. @@ -453,7 +454,6 @@ func (me *Client) connectionLoop(torrent *torrent, conn *connection) error { if err != nil { return err } - me.replenishConnRequests(torrent, conn) } }