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

Attempt direct read on ResourceInputStream::read() #24

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

kelunik
Copy link
Member

@kelunik kelunik commented Oct 6, 2017

I suspect the read buffer is filled by OpenSSL in another I/O operation and then the stream is never marked readable again, because the readable data is already in PHP's buffer space. An instant read attempt solves this by always ensuring the read buffer is completely empty.

/cc @brstgt @bwoebi @trowski

@kelunik
Copy link
Member Author

kelunik commented Oct 6, 2017

That also solves #21 I think.

@kelunik
Copy link
Member Author

kelunik commented Oct 6, 2017

It still hangs with that PR.

@kelunik
Copy link
Member Author

kelunik commented Oct 8, 2017

Closing for now.

This change should resolve the low performance on Windows' STDIN. STDIN
on Windows is a file handle and Windows has specialized support built
into it's stream_select implementation, but a stream_select with a file
handle takes 100ms, which results in slow performance if we read in
smaller chunks and always have to wait 100ms between these.

Fixes amphp/socket#52.
@kelunik kelunik merged commit a4739c8 into master Mar 8, 2018
@kelunik kelunik deleted the fix-artax-issue-138 branch March 8, 2018 10:38
This was referenced Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant