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

fix using FSEEK_END with SeekableHttpStream to get file size #33718

Merged
merged 1 commit into from Sep 15, 2022

Conversation

icewind1991
Copy link
Member

Delays the reconnect on fseek to allow fseek(0, FSEEK_END) to return successfully.

This is used by some libraries to get the filesize from stream.

Adds tests to ensure that this method can be used for all storage backends.

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Aug 26, 2022
@icewind1991 icewind1991 added this to the Nextcloud 25 milestone Aug 26, 2022
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@szaimen
Copy link
Contributor

szaimen commented Aug 29, 2022

Seems like some tests fail?

@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 29, 2022
@icewind1991
Copy link
Member Author

Improved the typings around current a bit

@come-nc
Copy link
Contributor

come-nc commented Aug 29, 2022

You need to run composer run cs:fix

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

Apart from codesniffer and psalm fixes this now looks good.

@PVince81
Copy link
Member

object store azure fails with:

1) Test\Files\ObjectStore\AzureTest::testFseekSize
fseek(): stream does not support seeking

/drone/src/tests/lib/Files/ObjectStore/ObjectStoreTest.php:156

This was referenced Sep 6, 2022
@skjnldsv skjnldsv mentioned this pull request Sep 15, 2022
@icewind1991
Copy link
Member Author

Disabled the test in azure for now and will look into fixing azure seek support in a separate PR

@PVince81 PVince81 added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Sep 15, 2022
Signed-off-by: Robin Appelman <robin@icewind.nl>
@PVince81 PVince81 merged commit 0023a10 into master Sep 15, 2022
@PVince81 PVince81 deleted the seekable-http-fseek-end branch September 15, 2022 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants