X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=global.go;h=5a5bddba0a6b3acfebea35d8f21d908a38ce3be0;hb=HEAD;hp=bd94fe55c45cb64021636f4b7fe91e306de83599;hpb=fd8995dcfd192a5678e329cb5688b5978382c422;p=btrtrc.git diff --git a/global.go b/global.go index bd94fe55..5a5bddba 100644 --- a/global.go +++ b/global.go @@ -12,8 +12,11 @@ const ( defaultChunkSize = 0x4000 // 16KiB // Arbitrary maximum of "metadata_size" (see https://www.bittorrent.org/beps/bep_0009.html) - // This value is 2x what libtorrent-rasterbar uses, which should be plenty - maxMetadataSize uint32 = 8 * 1024 * 1024 + // libtorrent-rasterbar uses 4MiB at last check. TODO: Add links to values used by other + // implementations here. I saw 14143527 in the metainfo for + // 3597f16e239aeb8f8524a1a1c4e4725a0a96b470. Large values for legitimate torrents should be + // recorded here for consideration. + maxMetadataSize uint32 = 16 * 1024 * 1024 ) // These are our extended message IDs. Peers will use these values to @@ -21,10 +24,11 @@ const ( const ( metadataExtendedId = iota + 1 // 0 is reserved for deleting keys pexExtendedId + utHolepunchExtendedId ) func defaultPeerExtensionBytes() PeerExtensionBits { - return pp.NewPeerExtensionBytes(pp.ExtensionBitDHT, pp.ExtensionBitExtended, pp.ExtensionBitFast) + return pp.NewPeerExtensionBytes(pp.ExtensionBitDht, pp.ExtensionBitLtep, pp.ExtensionBitFast) } func init() {