]> Sergey Matveev's repositories - btrtrc.git/commit
Prevent bad metadata_size in extended handshakes from stalling completion of metadata
authorMatt Joiner <anacrolix@gmail.com>
Fri, 27 Mar 2015 04:36:59 +0000 (15:36 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 27 Mar 2015 04:36:59 +0000 (15:36 +1100)
commit60d8ea75a2e4cd1f7a713ddc907faefcca466405
treedbbe58fa4a68fc537b4b35749571d9e4e1d42ec4
parent5f7ad4c7693e589f89efbf15d114a9999f1f619c
Prevent bad metadata_size in extended handshakes from stalling completion of metadata

Occasionally bad peers send ridiculous or incorrect metadata_size in their handshakes. If the first acceptable size is wrong, and too small, we'll keep failing metadata completion. If it's too large, honest peers will never send us the pieces we're asking for and we'll never complete the metadata. Now we just adjust the expected metadata size, and keep retrying until we finish. Additionally, we can now request metadata after sending initial messages.
client.go
connection.go
torrent.go