]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Panic on chunk write errors
authorMatt Joiner <anacrolix@gmail.com>
Sun, 10 Mar 2019 23:45:43 +0000 (10:45 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 10 Mar 2019 23:46:06 +0000 (10:46 +1100)
The torrent client will download indefinitely when this occurs, a strategy to handle or raise the error more appropriately is required.

connection.go

index 85f462a3bcc2b90622a13c760826429f6090ec4b..28152d5a60c13630423f84dcd94ef1cd523d5706 100644 (file)
@@ -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