Tickle sleeping writers when closing connections

This prevents them sleeping for an indefinite period (although something seemed to wake them eventually).
This commit is contained in:
Matt Joiner 2018-02-03 15:44:03 +11:00
parent e1ea10fa2d
commit 64d13d86a6
1 changed files with 1 additions and 0 deletions

View File

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