From da8ac9fe018c0a031febb285c609eb8e85d90026 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 4 Aug 2015 01:29:40 +1000 Subject: [PATCH] Log errant unwanted piece rather than panic Eventually I'll work out what causes this, but for now it's incredibly rare. --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index ec3f94dc..8760c283 100644 --- a/client.go +++ b/client.go @@ -2480,7 +2480,9 @@ func (me *Client) fillRequests(t *torrent, c *connection) { panic("piece in request order but peer doesn't have it") } if !t.wantPiece(pieceIndex) { - panic("unwanted piece in connection request order") + log.Printf("unwanted piece %d in connection request order\n%s", pieceIndex, c) + c.pieceRequestOrder.DeletePiece(pieceIndex) + continue } piece := t.Pieces[pieceIndex] for _, cs := range piece.shuffledPendingChunkSpecs(t.pieceLength(pieceIndex), pp.Integer(t.chunkSize)) { -- 2.48.1