alanmcgovern / monotorrent

The official repository for MonoTorrent, a bittorrent library for .NET
https://github.com/alanmcgovern/monotorrent
MIT License
1.16k stars 397 forks source link

Fix two issues affecting webseeds #665

Closed alanmcgovern closed 3 months ago

alanmcgovern commented 3 months ago

1) Ensure web requests request data in-order by fixing the piecepicker to correctly use 'CanRequestMorePieces'

2) Fix a bug in the handling of padding files. A request for some data from a webseed needs to take padding files into account in all cases. A request can begin or end inside padding, it can also begin/end in regular files while optionally crossing one stretch of padding. This means the existing logic to insert synethic requests to the padding file are broken in a number of cases.