From c817776fda9a3579bf1ebbd082513f1260a53742 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 23 Dec 2014 15:20:28 +1100 Subject: [PATCH] Don't include active handshakes in the half open limit Large numbers of incoming connections choke initiation of outbound conns. --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 06b646d9..59b85b7c 100644 --- 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 ( -- 2.48.1