Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the test which validates empty files in hybrid torrents (issue #685) #686

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

alanmcgovern
Copy link
Owner

The test didn't verify the underlying bencoded dictionary contained no 'pieces root', but it did verify that no pieces root was loaded for zero length files.

This fixes one potential source of incompatibility when working with zero length files.

The test didn't verify the underlying bencoded dictionary contained no
'pieces root', but it did verify that no pieces root was loaded for zero
length files.

This fixes one potential source of incompatibility when working with
zero length files.
They were out of sync when empty files were in the torrent, however due
to interesting quirks, this didn't cause the infohash or any piece
hashes to be incorrect as only empty files were out-of-order.

Fix this by resorting the files one more time before putting them in the
torrent metadata.

Also - this is only detectable by directly validating the content of the
BEncodedDictionary for some reason. A validation was missing while
parsing the underlying BENcodedDictionary, it was written to operate on
the parsed ITorrentFile objects instead, and at that point it was all
correct.
@alanmcgovern alanmcgovern merged commit 3d27793 into master Aug 27, 2024
2 checks passed
@alanmcgovern alanmcgovern deleted the torrent-creation-hybrid-torrent branch August 27, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant