-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix big file download for 32-bit servers #33197
Conversation
When a folder larger than ~2GB is downloaded, zip32 doesn't cut it. Since zip64 doesn't work on 32-bit clients, fall back to generating a tarball. Fixes nextcloud#12422 and nextcloud#15117 Signed-off-by: fwsmit <fw.smit01@gmail.com>
I don't think the two failed tests are because of the code change. |
Hi, thanks for the PR but 32bit is officially not supported anymore. See nextcloud/documentation#9071 |
I saw that as well. But does that mean no PR are accepted that improve 32 bit? As I said, this should not affect 64 bit |
* @param int $numberOfFiles The number of files (and directories) that will | ||
* be included in the streamed file | ||
*/ | ||
public function __construct(IRequest $request, int $size, int $numberOfFiles) { | ||
public function __construct(IRequest $request, $size, int $numberOfFiles) { |
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.
this is not acceptable
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.
See #16636
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've read that issue. When size is bigger than a 32 bit int can handle, the size overflows to a float. This will not be as accurate, but there is an error margin.
As for 64 bit systems you are only losing the safety that the type hint provides. It's that unacceptable? If so, is there another way of fixing this that would be accepted? For example, checking if 32 bit and calling another function all together?
EDIT: I could also overload the streamer class to provide a 32 bit variant
Hi, is there any way a fix for this issue can be accepted upstream? I've mentioned a few ways to do it in the review comments. |
Hi @szaimen, I've asked for clarification about the 32-bit support on the nextcloud forums: https://help.nextcloud.com/t/clear-up-situation-around-32-bit/143779. After discussion with the developers, it seems that 32-bit patches could be accepted:
So as for the actual PR, I get that it's a bit of a hack. If that's not acceptable to you, I see only 2 alternatives:
Seeing as 32-bit is not officially supported anymore, I think that adding a library is not the way to go. So that leaves use with making a separate function for 32-bit downloads. I don't see any problems with that. There is no risk of regressing the 64-bit servers (except if adding a single 32-bit check would be a big performance hit, but I don't think so) and the hack stays confined in the 32-bit space. Let me know what you think. |
Honestly, I don't think adding any workaround for 32bit is acceptable now that 32bit is completely broken with NC25 which happened because we do not test against 32bit which was the main reason why we dropped 32bit support in the first place. |
When a folder larger than ~2GB is downloaded, zip32 doesn't cut it. Since zip64 doesn't work on 32-bit clients, fall back to generating a tarball on 32-bit servers. This PR doesn't change anything for 64-bit servers, since they can just use zip64
Fixes #12422 and #15117
Ref #16636: it only fixes the warning, but doesn't fix the issue of broken zip file generation.
Tested this change on the odroid-xu4 (armv7l, 32-bit)