From e33006a41929b01cd0ecb6668bb6a36323d8754f Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 26 Feb 2016 22:12:13 +1100 Subject: [PATCH] Ignore the corner case when a piece is dropped from storage --- client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 3a15bb3a..f60a4607 100644 --- a/client.go +++ b/client.go @@ -1336,7 +1336,11 @@ another: for r := range c.PeerRequests { err := me.sendChunk(t, c, r) if err != nil { - log.Printf("error sending chunk %+v to peer: %s", r, err) + if t.pieceComplete(int(r.Index)) && err == io.ErrUnexpectedEOF { + // We had the piece, but not anymore. + } else { + log.Printf("error sending chunk %+v to peer: %s", r, err) + } // If we failed to send a chunk, choke the peer to ensure they // flush all their requests. We've probably dropped a piece, // but there's no way to communicate this to the peer. If they -- 2.48.1