-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
feof may hang #46
Comments
Do we need the |
It seems like this works pretty well:
|
What happens if you only delete the |
There was no error, so it was fine but i guess the proper way should be to handle fwrite errors, shouldn't it? |
I'm just trying to understand why |
On macOS |
Using Edit: Looks like no, that is also an OS-dependent message. Removing the |
Does it fail also with the error handler? I get |
Platform dependent checks are always ugly. Error number will be better than message, because these messages can be localized. |
@brstgt The test still fails with the error handler. Maybe we should be looking at why |
If it results in a |
It hangs like 1 minute until the peer closes the socket (probably). Hang
means that feof is blocking and not returning. But the socket is working.
If the feof is omitted, the request finishes successfully
Am Di., 25. Dez. 2018, 13:22 hat Niklas Keller <notifications@github.com>
geschrieben:
… I encountered hanging feof resulting in StreamException("The stream was
closed by the peer").
If it results in a StreamException, it doesn't hang. Could you clarify
what *hang* means?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUQZxMjNfasCYn7-jdPO5QlohpVwXa4ks5u8hh0gaJpZM4ZeNHb>
.
|
The only thing I recall that might result in hanging are fragmented TLS records (packets), but we have never verified that. |
Seems like https://github.com/php/php-src/blob/9a497f5c10ee547234b678208875ef3490870bb7/ext/openssl/xp_ssl.c#L2475-L2476 is the problem that results in the hang. |
See php/php-src#3729 for a fix. |
The latest PHP releases are fixed now. |
I encountered hanging
feof
resulting inStreamException("The stream was closed by the peer")
.This happens when doing requests in Kubernetes to Facebook.
Omitting the feof check "fixes" it.
A workaround (and better code) would be to not check on
@feof
before the write but setting an error handler for thefwrite
and cathing warnings and converting them to stream exceptions.Example:
The text was updated successfully, but these errors were encountered: