Skip to content

fix using FSEEK_END with SeekableHttpStream to get file size - #33718

Merged
PVince81 merged 1 commit into
masterfrom
seekable-http-fseek-end
Sep 15, 2022
Merged

fix using FSEEK_END with SeekableHttpStream to get file size#33718
PVince81 merged 1 commit into
masterfrom
seekable-http-fseek-end

Conversation

@icewind1991

Copy link
Copy Markdown
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.

@icewind1991icewind1991 added the 3. to review Waiting for reviews label Aug 26, 2022
@icewind1991icewind1991 added this to the Nextcloud 25 milestone Aug 26, 2022

@PVince81PVince81 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@szaimen

Copy link
Copy Markdown
Contributor

Seems like some tests fail?

@szaimenszaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 29, 2022
Comment threadlib/private/Files/Stream/SeekableHttpStream.php Outdated
Comment threadlib/private/Files/Stream/SeekableHttpStream.php Outdated
Comment threadlib/private/Files/Stream/SeekableHttpStream.php
Comment threadlib/private/Files/Stream/SeekableHttpStream.php
@icewind1991
icewind1991force-pushed the seekable-http-fseek-end branch from 66a5067 to a5ad9a1CompareAugust 29, 2022 14:54
@icewind1991

Copy link
Copy Markdown
MemberAuthor

Improved the typings around current a bit

@come-nc

Copy link
Copy Markdown
Contributor

You need to run composer run cs:fix

Comment threadlib/private/Files/Stream/SeekableHttpStream.php Outdated

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

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.

@icewind1991
icewind1991force-pushed the seekable-http-fseek-end branch from a5ad9a1 to 841e361CompareAugust 29, 2022 17:11
@blizzzblizzz mentioned this pull request Aug 30, 2022
@icewind1991
icewind1991force-pushed the seekable-http-fseek-end branch from 841e361 to b65b837CompareAugust 30, 2022 18:10
@PVince81

Copy link
Copy Markdown
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
@skjnldsvskjnldsv mentioned this pull request Sep 15, 2022
@icewind1991

Copy link
Copy Markdown
MemberAuthor

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

@PVince81PVince81 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
Comment threadlib/private/Files/Stream/SeekableHttpStream.php Outdated
Signed-off-by: Robin Appelman <robin@icewind.nl>
@PVince81
PVince81 merged commit 0023a10 into masterSep 15, 2022
@PVince81
PVince81 deleted the seekable-http-fseek-end branch September 15, 2022 20:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@icewind1991@szaimen@come-nc@PVince81