From: Matt Joiner Date: Sat, 3 Feb 2018 04:44:03 +0000 (+1100) Subject: Tickle sleeping writers when closing connections X-Git-Tag: v1.0.0~210 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=64d13d86a6ba04269e2abacedcdd890165901010;p=btrtrc.git Tickle sleeping writers when closing connections This prevents them sleeping for an indefinite period (although something seemed to wake them eventually). --- diff --git a/connection.go b/connection.go index 1e7ef968..ada84b8e 100644 --- a/connection.go +++ b/connection.go @@ -232,6 +232,7 @@ func (cn *connection) Close() { if !cn.closed.Set() { return } + cn.tickleWriter() cn.discardPieceInclination() cn.pieceRequestOrder.Clear() if cn.conn != nil {