From: Matt Joiner Date: Thu, 29 Jan 2015 03:21:05 +0000 (+1100) Subject: connectionPruner should terminate when the torrent stops X-Git-Tag: v1.0.0~1355 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=336495c25b9e91fa320703cb1c81e60e135faeaa;p=btrtrc.git connectionPruner should terminate when the torrent stops --- 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 {