connection.go | 2 +- metainfo/hash.go | 4 ++++ torrent.go | 1 + diff --git a/connection.go b/connection.go index 5b129cec1f1a154a8026d94edede1bf30882cea7..69e294d5c1200883a272299d97b1fac00867e5e3 100644 --- a/connection.go +++ b/connection.go @@ -989,7 +989,7 @@ 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 6affe62f685422202d8903a2366ec58dad1e43fd..d1c832b0bdd50d8b97446ca3b837b1c6428fef31 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 d51dbbe7adcadb8bee7da0af354f3239c1a56258..beff7d212c22f6b2248dc0d5102f5526264a33cf 100644 --- a/torrent.go +++ b/torrent.go @@ -1417,6 +1417,7 @@ // don't here. But there's a test failure, and it seems clients don't care // 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()