]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Trivial logging, comment, Stringer changes
authorMatt Joiner <anacrolix@gmail.com>
Thu, 2 Feb 2017 05:53:19 +0000 (16:53 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 2 Feb 2017 05:53:19 +0000 (16:53 +1100)
connection.go
metainfo/hash.go
torrent.go

index 5b129cec1f1a154a8026d94edede1bf30882cea7..69e294d5c1200883a272299d97b1fac00867e5e3 100644 (file)
@@ -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
index 6affe62f685422202d8903a2366ec58dad1e43fd..d1c832b0bdd50d8b97446ca3b837b1c6428fef31 100644 (file)
@@ -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[:])
 }
index d51dbbe7adcadb8bee7da0af354f3239c1a56258..beff7d212c22f6b2248dc0d5102f5526264a33cf 100644 (file)
@@ -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()