From 2e36ad19d9e54a2047089b3185832f7553933b9f Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 4 Feb 2018 19:14:46 +1100 Subject: [PATCH] Finish mainReadLoop on Torrent closed --- connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 3824fc3d..6e22efc9 100644 --- a/connection.go +++ b/connection.go @@ -898,7 +898,7 @@ func (c *connection) mainReadLoop() error { defer cl.mu.Lock() err = decoder.Decode(&msg) }() - if cl.closed.IsSet() || c.closed.IsSet() || err == io.EOF { + if t.closed.IsSet() || c.closed.IsSet() || err == io.EOF { return nil } if err != nil {