]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't include active handshakes in the half open limit
authorMatt Joiner <anacrolix@gmail.com>
Tue, 23 Dec 2014 04:20:28 +0000 (15:20 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 23 Dec 2014 04:20:28 +0000 (15:20 +1100)
Large numbers of incoming connections choke initiation of outbound conns.

client.go

index 06b646d92359e7e2a09f6ddaf7011f2007c3f510..59b85b7cd76123d231fadbf9d9b9d3dcacdf68bd 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1438,7 +1438,7 @@ func (me *Client) openNewConns(t *torrent) {
                if !me.wantConns(t) {
                        return
                }
-               if len(t.HalfOpen)+me.handshaking >= me.halfOpenLimit {
+               if len(t.HalfOpen) >= me.halfOpenLimit {
                        return
                }
                var (