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 checking and testing of max piece size #7514

Merged
merged 1 commit into from Nov 14, 2023
Merged

improve checking and testing of max piece size #7514

merged 1 commit into from Nov 14, 2023

Conversation

arvidn
Copy link
Owner

@arvidn arvidn commented Sep 3, 2023

a variant of @Chocobo1's patch: #7512

@@ -980,7 +984,7 @@ void sanity_check(std::shared_ptr<torrent_info> const& ti)
// for it, it's still no good.
piece_picker pp(ti->total_size(), ti->piece_length());

TEST_CHECK(ti->piece_length() < std::numeric_limits<int>::max() / 2);
TEST_CHECK(ti->piece_length() <= (std::numeric_limits<int>::max() / 2 + 1));
Copy link
Contributor

@Chocobo1 Chocobo1 Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems you could remove this check? or change it to

TEST_CHECK(ti->piece_length() <= file_storage::max_piece_size);

@arvidn arvidn merged commit 3a6b331 into RC_2_0 Nov 14, 2023
39 of 42 checks passed
@arvidn arvidn deleted the piece-size branch November 14, 2023 21:55
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.

None yet

2 participants