]> Sergey Matveev's repositories - btrtrc.git/commit
Kick connections that contribute the final piece of missing metadata that fails to...
authorMatt Joiner <anacrolix@gmail.com>
Sat, 23 Jul 2016 14:34:40 +0000 (00:34 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 23 Jul 2016 14:34:40 +0000 (00:34 +1000)
commit3c75f684132cba00cbf92fdffb99fd10488509a3
treebf5cc66db5eeb74de2cfae5bf29f82b7eb244524
parent14e10ad58d7a0ed3ab32634ad7baaf950107f38b
Kick connections that contribute the final piece of missing metadata that fails to validate

Failing to get metainfo was resetting Torrent.metadataBytes, which caused arriving metadata data to appear to belong to nonexistent pieces, despite passing the check that we'd in fact requested them from the sending connection. This was unnecessarily noisy. Instead return an error if we got all the data, but couldn't set the Torrent's info bytes, that should propagate out and cause the connection that contributed the final missing piece to be dropped. This will at least provide some improved resistance to unfriendly behaviour on the network.
client.go
torrent.go