]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Solve the mystery bug with TestMaxEstablishedConns
authorMatt Joiner <anacrolix@gmail.com>
Thu, 7 Jul 2016 04:49:18 +0000 (14:49 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 7 Jul 2016 04:49:18 +0000 (14:49 +1000)
Adding Torrent by infohash wasn't triggering connections to be accepted, when both TCP and uTP were enabled.

client.go

index 2507e69c14b67d0dc885d492855f5bf6374efc4a..e5cdf0c2ae367eeb7aee0d401b16aa22708f0da8 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1475,6 +1475,8 @@ func (cl *Client) AddTorrentInfoHash(infoHash metainfo.Hash) (t *Torrent, new bo
        }
        cl.torrents[infoHash] = t
        t.updateWantPeersEvent()
+       // Tickle Client.waitAccept, new torrent may want conns.
+       cl.event.Broadcast()
        return
 }