You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@slowbro Some work has been done and some PRs are now in the capable hands of @clue.
Excellent troubleshooting and detail left in the previous issue! Just FYI on some of your comments and what's going on:
The only way I know to reproduce this involves a lot of steps and a specific product
Yup! When we first found this bug it wasn't (still isn't) easily reproducible. I think I remember having to stand on one leg while doing a rain dance to replicate it.
The issue is some C code in the PHP SSL module when asked how much data is remaining in its buffer will say 0 even though there's data left in it. This means to fully receive your message you'd have to send another one to jam it through, then that one becomes jammed.
The "fix" we're doing in SocketClient is a necessary evil of sorts...stream_get_contents is like running a while loop asking for data from the buffer until it's truly empty. This could cause blocking if a client is malicious and not letting other connections access the event loop. However, in the case of a SocketClient that's not likely and is a risk worth taking as opposed to the entire lib not working properly.
Activity
Always Stream if SSL
cboden commentedon Feb 3, 2015
@slowbro Some work has been done and some PRs are now in the capable hands of @clue.
Excellent troubleshooting and detail left in the previous issue! Just FYI on some of your comments and what's going on:
Yup! When we first found this bug it wasn't (still isn't) easily reproducible. I think I remember having to stand on one leg while doing a rain dance to replicate it.
The issue is some C code in the PHP SSL module when asked how much data is remaining in its buffer will say 0 even though there's data left in it. This means to fully receive your message you'd have to send another one to jam it through, then that one becomes jammed.
The "fix" we're doing in SocketClient is a necessary evil of sorts...stream_get_contents is like running a while loop asking for data from the buffer until it's truly empty. This could cause blocking if a client is malicious and not letting other connections access the event loop. However, in the case of a SocketClient that's not likely and is a risk worth taking as opposed to the entire lib not working properly.
slowbro commentedon Feb 3, 2015
Thanks @cboden!
cboden commentedon Mar 20, 2015
Merged. v0.4.3 being tagged shortly.