From 336495c25b9e91fa320703cb1c81e60e135faeaa Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 29 Jan 2015 14:21:05 +1100 Subject: [PATCH] connectionPruner should terminate when the torrent stops --- client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.go b/client.go index ff8dbf4b..cd65f55d 100644 --- a/client.go +++ b/client.go @@ -1735,6 +1735,10 @@ func (cl *Client) connectionPruner(t *torrent) { for { time.Sleep(15 * time.Second) cl.mu.Lock() + select { + case <-t.ceasingNetworking: + default: + } license := len(t.Conns) - (socketsPerTorrent+1)/2 for _, c := range t.Conns { if license <= 0 { -- 2.48.1