From: Matt Joiner Date: Fri, 26 Feb 2016 11:12:13 +0000 (+1100) Subject: Ignore the corner case when a piece is dropped from storage X-Git-Tag: v1.0.0~838 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e33006a41929b01cd0ecb6668bb6a36323d8754f;p=btrtrc.git Ignore the corner case when a piece is dropped from storage --- 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