client.go | 6 +++++- misc.go | 11 +++++++---- diff --git a/client.go b/client.go index 3eef1580cecc54fb7e677d8abab76295736894db..e18e60f5f3d0628e7db2d2ffe5989a116a2d6a07 100644 --- a/client.go +++ b/client.go @@ -89,10 +89,14 @@ handshakesTimeout = 20 * time.Second pruneInterval = 10 * time.Second + // These are our extended message IDs. metadataExtendedId = iota + 1 // 0 is reserved for deleting keys pexExtendedId - extendedHandshakeClientVersion = "go.torrent dev 20140825" + // Updated occasionally to when there's been some changes to client + // behaviour in case other clients are assuming anything of us. See also + // `bep20`. + extendedHandshakeClientVersion = "go.torrent dev 20150624" ) // Currently doesn't really queue, but should in the future. diff --git a/misc.go b/misc.go index 3cf1b8ee75b1dba2d78dca0de4d9a43c0d9d07d3..532d4a72b9477f009b2c7d1fecab03cf0a4db817 100644 --- a/misc.go +++ b/misc.go @@ -11,10 +11,13 @@ pp "github.com/anacrolix/torrent/peer_protocol" ) const ( - pieceHash = crypto.SHA1 - maxRequests = 250 // Maximum pending requests we allow peers to send us. - chunkSize = 0x4000 // 16KiB - bep20 = "-GT0000-" // Peer ID client identifier prefix + pieceHash = crypto.SHA1 + maxRequests = 250 // Maximum pending requests we allow peers to send us. + chunkSize = 0x4000 // 16KiB + // Peer ID client identifier prefix. We'll update this occasionally to + // reflect changes to client behaviour that other clients may depend on. + // Also see `extendedHandshakeClientVersion`. + bep20 = "-GT0001-" nominalDialTimeout = time.Second * 30 minDialTimeout = 5 * time.Second )