]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tickle sleeping writers when closing connections
authorMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 04:44:03 +0000 (15:44 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 04:44:03 +0000 (15:44 +1100)
This prevents them sleeping for an indefinite period (although something seemed to wake them eventually).

connection.go

index 1e7ef968a53348feac84479f41433d3a8bc2d3c1..ada84b8e1f26e5ad48c05ebc36e6eab1242d870d 100644 (file)
@@ -232,6 +232,7 @@ func (cn *connection) Close() {
        if !cn.closed.Set() {
                return
        }
+       cn.tickleWriter()
        cn.discardPieceInclination()
        cn.pieceRequestOrder.Clear()
        if cn.conn != nil {