From: Matt Joiner Date: Thu, 2 Feb 2017 05:53:19 +0000 (+1100) Subject: Trivial logging, comment, Stringer changes X-Git-Tag: v1.0.0~487 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=79d800fe92645350f0ee4da856a279013cf030e8;p=btrtrc.git Trivial logging, comment, Stringer changes --- diff --git a/connection.go b/connection.go index 5b129cec..69e294d5 100644 --- a/connection.go +++ b/connection.go @@ -989,7 +989,7 @@ func (c *connection) receiveChunk(msg *pp.Message) { piece.decrementPendingWrites() if err != nil { - log.Printf("%s: error writing chunk %v: %s", t, req, err) + log.Printf("%s (%x): error writing chunk %v: %s", t, t.infoHash, req, err) t.pendRequest(req) t.updatePieceCompletion(int(msg.Index)) return diff --git a/metainfo/hash.go b/metainfo/hash.go index 6affe62f..d1c832b0 100644 --- a/metainfo/hash.go +++ b/metainfo/hash.go @@ -17,6 +17,10 @@ func (h Hash) AsString() string { return string(h[:]) } +func (h Hash) String() string { + return h.HexString() +} + func (h Hash) HexString() string { return fmt.Sprintf("%x", h[:]) } diff --git a/torrent.go b/torrent.go index d51dbbe7..beff7d21 100644 --- a/torrent.go +++ b/torrent.go @@ -1417,6 +1417,7 @@ func (t *Torrent) onIncompletePiece(piece int) { // if you request pieces that you already claim to have. Pruning bad // connections might just remove any connections that aren't treating us // favourably anyway. + // for c := range t.conns { // if c.sentHave(piece) { // c.Drop()