client.go | 6 ++---- diff --git a/client.go b/client.go index 04087aaa21078671c0b17744161d613bca0056f3..048cc8a110f95305e4de8b4c6735da475d63689b 100644 --- a/client.go +++ b/client.go @@ -267,9 +267,7 @@ me.mu.Lock() close(me.quit) me.event.Broadcast() for _, t := range me.torrents { - for _, c := range t.Conns { - c.Close() - } + t.Close() } me.mu.Unlock() } @@ -929,10 +927,10 @@ } } func (me *Client) dropConnection(torrent *torrent, conn *connection) { - conn.Socket.Close() for r := range conn.Requests { me.connDeleteRequest(torrent, conn, r) } + conn.Close() for i0, c := range torrent.Conns { if c != conn { continue