-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
raise the max piece size to 512 MiB and fix check when loading torrents #7736
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,9 +97,9 @@ namespace libtorrent { | |
// priority factor | ||
prio_factor = 3, | ||
// max blocks per piece | ||
// there are counters in downloading_piece that only have 15 bits to | ||
// there are counters in downloading_piece that only have 16 bits to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see that the counter itself was changed. Just this comment... Or is it a 16-bit size already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah, I thought it was about something else. |
||
// count blocks per piece, that's restricting this | ||
max_blocks_per_piece = (1 << 15) - 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the reason this wasn't caught early was because this |
||
max_blocks_per_piece = (1 << 16) - 1 | ||
}; | ||
|
||
struct block_info | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by bumping this to 16 bits, the max piece size goes to 512 MiB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
num_dirty
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that should be wider too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And
pinned
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you haven't lost sight of it. It is also 15 bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm tempted to just fix the check rather than mucking about with this struct. Do you think there's a legitimate use for torrents with piece sizes this large? It really seems questionable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only know that the problem was reported by users... In addition, what seemed meaningless yesterday or today will become commonplace tomorrow.
Support for 512 MiB piece size does not require major changes, so why not add it?
Still, I don't insist. The correct processing of limits is good in itself. But I would still expand the potential capacity in upcoming major update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be much more reasonable to grow torrents in the number of pieces, rather than piece size.