-
Notifications
You must be signed in to change notification settings - Fork 58
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
Work around file size issues at 32 Bit systems #74
Conversation
Replace stream_copy_to_stream with a chunked process, to handle file sizes hat do not fit into an integer. Implementation according to http://php.net/manual/en/function.stream-copy-to-stream.php#98119, proposed and implemented by https://github.com/rikmeijer in nextcloud/server#1707 (comment).
Filed a php bug https://bugs.php.net/bug.php?id=74395 |
@evert what do you think of that 'workaround' ? |
I guess we could also detect 32 bit builds and use the workaround only there. That way 64bit builds would not suffer from this workaround (perf wise) |
Good idea, relating to PHP_INT_SIZE. I would not mind it being (if even noticeable) slower on 32 Bit. |
Is there any plan to merge this update ? what do you think ? Otherwise please close. |
solves: |
Please make the workarround 32bit only and I will merge this PR |
Thanks a lot ! I updated the request accordingly: |
merged and release 4.2.3 |
Thank you! |
} else { | ||
// workaround for 32 Bit systems to avoid stream_copy_to_stream | ||
while (!feof($body)) { | ||
fwrite($output, fread($body, 8192)); |
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.
fwiw, 8192 seems low. I think you should push blocks 1MB at a time. It's not the 80's anymore ;)
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.
as this path is used for 32bit php its a bit like php from the 80's :-)
Replace stream_copy_to_stream with a chunked process, to handle file sizes hat do not fit into an integer.
Implementation according to http://php.net/manual/en/function.stream-copy-to-stream.php#98119, proposed and implemented by https://github.com/rikmeijer in nextcloud/server#1707 (comment).