connection.go | 2 ++ peer_protocol/decoder.go | 2 +- peer_protocol/protocol.go | 2 +- torrent_test.go | 2 +- diff --git a/connection.go b/connection.go index c791fb15a504b78217d3957e5332cba2e30bdca1..9bc131240beab7a5656044346e4861a7fb3271b2 100644 --- a/connection.go +++ b/connection.go @@ -1472,6 +1472,8 @@ if n < 0 { panic(n) } c.updateRequests() + // TODO: Other connections that aren't interested, and can provide this + // chunk might be wakeable? return true } diff --git a/peer_protocol/decoder.go b/peer_protocol/decoder.go index f07ed14be0cf1af689ecb7df36a3eb992faae119..47a8b65ebae7d7e045471af99fb0e3928911ffc6 100644 --- a/peer_protocol/decoder.go +++ b/peer_protocol/decoder.go @@ -35,7 +35,7 @@ msg.Keepalive = true return } msg.Keepalive = false - r := &io.LimitedReader{R:d.R, N:int64(length)} + r := &io.LimitedReader{R: d.R, N: int64(length)} // Check that all of r was utilized. defer func() { if err != nil { diff --git a/peer_protocol/protocol.go b/peer_protocol/protocol.go index cf3e6e3df7b4511c9f2cb49c74332bce611e4780..c31a7e75c311dc04596528fb5c6ae62f8b85059b 100644 --- a/peer_protocol/protocol.go +++ b/peer_protocol/protocol.go @@ -25,7 +25,7 @@ Piece MessageType = 7 Cancel MessageType = 8 Port MessageType = 9 - // BEP 6 + // BEP 6 - Fast extension Suggest MessageType = 0x0d // 13 HaveAll MessageType = 0x0e // 14 HaveNone MessageType = 0x0f // 15 diff --git a/torrent_test.go b/torrent_test.go index 34e5e225b1a3b09d89c3d4554f1624eb678047e0..e10cc5289bd830f0245e0c296267623438eb19f2 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -189,7 +189,7 @@ require.NoError(t, err) assert.True(t, ok) assert.True(t, hr.PeerExtensionBits.GetBit(pp.ExtensionBitExtended)) assert.EqualValues(t, cl.PeerID(), hr.PeerID) - assert.Equal(t, ih, hr.Hash) + assert.EqualValues(t, ih, hr.Hash) assert.EqualValues(t, 0, tt.metadataSize())