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 checking for seekable stream resources #121

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@nicolas-grekas
Copy link

commented Jul 3, 2019

Userland stream wrappers always return true for the "seekable" metadata, yet this can be wrong. Here is a more accurate check.

@Zegnat

This comment has been minimized.

Copy link
Collaborator

commented Jul 8, 2019

This is a clever seek test. Looks great. Wondering why Travis is complaining here 🤔 I’ll try and take this for a test spin later this week and do an actual review.

@hermann8u

This comment has been minimized.

Copy link

commented Jul 10, 2019

Hi,

Am I missing something or the parameters of the fseek function are not in the right order?

Should'nt it be like this:
\fseek($new->stream, 0, \SEEK_CUR)

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:patch-1 branch from c658688 to 53f5efc Jul 10, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

\fseek($new->stream, 0, \SEEK_CUR)

indeed! fixed thanks.

@Zegnat

This comment has been minimized.

Copy link
Collaborator

commented Jul 11, 2019

Can we add a test that breaks with the current code but is fixed by this PR? To make sure we do not regress this at a future point?
Is there a small enough “userland stream wrapper” that it makes sense to include one?

Fix checking for seekable stream resources
Userland stream wrappers always return true for the "seekable" metadata, yet this can be wrong. Here is a more accurate check.

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:patch-1 branch from 53f5efc to bb10aaa Jul 11, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

Test added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.