]> Sergey Matveev's repositories - btrtrc.git/commitdiff
If closing a connection Conn fails we can't do anything, and there's nothing to say
authorMatt Joiner <anacrolix@gmail.com>
Thu, 12 Oct 2017 06:51:47 +0000 (17:51 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 12 Oct 2017 06:51:47 +0000 (17:51 +1100)
connection.go

index ba1d1e1e7c42e02621abeaa41f01a09d58e77885..faa7c9220eb6b141f91ecf6093bddf40243bb248 100644 (file)
@@ -230,14 +230,7 @@ func (cn *connection) Close() {
        cn.discardPieceInclination()
        cn.pieceRequestOrder.Clear()
        if cn.conn != nil {
-               go func() {
-                       // TODO: This call blocks sometimes, why? Maybe it was the Go utp
-                       // implementation?
-                       err := cn.conn.Close()
-                       if err != nil {
-                               log.Printf("error closing connection net.Conn: %s", err)
-                       }
-               }()
+               go cn.conn.Close()
        }
 }