-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Properly read any remaining data when closing FastCGI socket #1745
Conversation
For comparison, here is the line removed by the breaking commit: 18cf4e0#diff-1256ef53aadc744b8d88ba15d2148801L916 |
@laruence Can you review this change? |
@nikic this in generally is more robust than previous one. will merge it.. |
Any chance of getting this backported to PHP7.0? As mentioned, it's a fairly serious bug causing total failure for ownCloud, with a fairly common configuration |
@Xenopathic already done. thanks |
I don't happen to see this patch in PHP 7.0.3 as per https://github.com/php/php-src/commits/php-7.0.3 but in the php-7.0.0 branch. Does this mean this will be included with PHP 7.0.4? |
@Xenopathic Thank you very much for this fix! It was the cause of problems I was seeing with my nginx/fpm php7 setup and chunked-encoding. The commit was also amongst the ones I figured introduced this. I also wrote to the mailing list but never got a reply there https://marc.info/?l=php-internals&m=145090900217798&w=2 . For full disclosure: prior to this fix, with a simple script like this: <?php
echo str_repeat('.', 512); and this curl command: Also nginx would show: So, again, thanks :-) |
@mfn No problem, fixes benefit everyone - that's the beauty of open-source software 😄 Besides, PHP has a relatively clean codebase compared to some other C projects, and it was good fun getting acquainted with it. |
@LukasReschke https://secure.php.net/ChangeLog-7.php#7.0.3 doesn't contain that fix so it probably will be 7.0.4 |
Just as a follow-up: Even that the Changelog doesn't contain a hint this fix seems to be included in 7.0.4: |
Fixes a regression (https://bugs.php.net/bug.php?id=71466) introduced in PHP7 by 18cf4e0, where under certain conditions the connection would be closed before all data was processed.
Prior to the linked breaking commit, this is the code that was used during
fcgi_close()
, specifically looping overrecv()
until all data was consumed. Just doing onerecv()
doesn't work correctly.Downstream report: owncloud/core#21935