From: Matt Joiner Date: Sun, 10 Mar 2019 23:45:43 +0000 (+1100) Subject: Panic on chunk write errors X-Git-Tag: v1.1.0~5 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=20de43a42cd3af55b434a68621e6a6304a83e55f;p=btrtrc.git Panic on chunk write errors The torrent client will download indefinitely when this occurs, a strategy to handle or raise the error more appropriately is required. --- diff --git a/connection.go b/connection.go index 85f462a3..28152d5a 100644 --- a/connection.go +++ b/connection.go @@ -1338,7 +1338,7 @@ func (c *connection) receiveChunk(msg *pp.Message) error { piece.decrementPendingWrites() if err != nil { - c.t.logger.Printf("%s (%s): error writing chunk %v: %s", t, t.infoHash, req, err) + panic(fmt.Sprintf("error writing chunk: %v", err)) t.pendRequest(req) t.updatePieceCompletion(pieceIndex(msg.Index)) return nil