Finish mainReadLoop on Torrent closed

This commit is contained in:
Matt Joiner 2018-02-04 19:14:46 +11:00
parent 44e44637bf
commit 2e36ad19d9
1 changed files with 1 additions and 1 deletions

View File

@ -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 {