client.go | 19 ++++++++++++------- diff --git a/client.go b/client.go index 8621d16425bb65a0adab5e1f1a65867fd95bfff0..54d5b9967ca653907e13f632cbf85841f5b838d8 100644 --- a/client.go +++ b/client.go @@ -78,11 +78,15 @@ const ( // Justification for set bits follows. // - // Extension protocol: http://www.bittorrent.org/beps/bep_0010.html ([5]|=0x10) - // DHT: http://www.bittorrent.org/beps/bep_0005.html ([7]|=1) - // Fast Extension: - // http://bittorrent.org/beps/bep_0006.html ([7]|=4) - // Disabled until AllowedFast is implemented + // Extension protocol ([5]|=0x10): + // http://www.bittorrent.org/beps/bep_0010.html + // + // Fast Extension ([7]|=0x04): + // http://bittorrent.org/beps/bep_0006.html. + // Disabled until AllowedFast is implemented. + // + // DHT ([7]|=1): + // http://www.bittorrent.org/beps/bep_0005.html defaultExtensionBytes = "\x00\x00\x00\x00\x00\x10\x00\x01" socketsPerTorrent = 80 @@ -819,12 +823,12 @@ } else if c != nil { return } nc.Close() - // Try again without encryption, using whichever protocol type worked last - // time. if me.config.DisableEncryption { // We already tried without encryption. return } + // Try again without encryption, using whichever protocol type worked last + // time. if utp { nc, err = me.dialUTP(addr, t) } else { @@ -2242,6 +2246,7 @@ if err != nil { log.Printf("error getting peers from dht: %s", err) return } + // Count all the unique addresses we got during this announce. allAddrs := make(map[string]struct{}) getPeers: for {