{"action":"created","issue":{"url":"https://api.github.com/repos/php/php-src/issues/1745","repository_url":"https://api.github.com/repos/php/php-src","labels_url":"https://api.github.com/repos/php/php-src/issues/1745/labels{/name}","comments_url":"https://api.github.com/repos/php/php-src/issues/1745/comments","events_url":"https://api.github.com/repos/php/php-src/issues/1745/events","html_url":"https://github.com/php/php-src/pull/1745","id":129793618,"number":1745,"title":"Properly read any remaining data when closing FastCGI socket","user":{"login":"Xenopathic","id":2016878,"avatar_url":"https://avatars.githubusercontent.com/u/2016878?v=3","gravatar_id":"","url":"https://api.github.com/users/Xenopathic","html_url":"https://github.com/Xenopathic","followers_url":"https://api.github.com/users/Xenopathic/followers","following_url":"https://api.github.com/users/Xenopathic/following{/other_user}","gists_url":"https://api.github.com/users/Xenopathic/gists{/gist_id}","starred_url":"https://api.github.com/users/Xenopathic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xenopathic/subscriptions","organizations_url":"https://api.github.com/users/Xenopathic/orgs","repos_url":"https://api.github.com/users/Xenopathic/repos","events_url":"https://api.github.com/users/Xenopathic/events{/privacy}","received_events_url":"https://api.github.com/users/Xenopathic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-29T15:18:50Z","updated_at":"2016-02-05T18:00:12Z","closed_at":"2016-01-30T04:39:49Z","pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1745","html_url":"https://github.com/php/php-src/pull/1745","diff_url":"https://github.com/php/php-src/pull/1745.diff","patch_url":"https://github.com/php/php-src/pull/1745.patch"},"body":"Fixes a regression (https://bugs.php.net/bug.php?id=71466) introduced in PHP7 by 18cf4e0a8a574034f60f4d123407c173e57e54ec, where under certain conditions the connection would be closed before all data was processed.\r\n\r\nPrior to the linked breaking commit, this is the code that was used during `fcgi_close()`, specifically looping over `recv()` until all data was consumed. Just doing one `recv()` doesn't work correctly.\r\n\r\nDownstream report: owncloud/core#21935"},"comment":{"url":"https://api.github.com/repos/php/php-src/issues/comments/180471409","html_url":"https://github.com/php/php-src/pull/1745#issuecomment-180471409","issue_url":"https://api.github.com/repos/php/php-src/issues/1745","id":180471409,"user":{"login":"mfn","id":87493,"avatar_url":"https://avatars.githubusercontent.com/u/87493?v=3","gravatar_id":"","url":"https://api.github.com/users/mfn","html_url":"https://github.com/mfn","followers_url":"https://api.github.com/users/mfn/followers","following_url":"https://api.github.com/users/mfn/following{/other_user}","gists_url":"https://api.github.com/users/mfn/gists{/gist_id}","starred_url":"https://api.github.com/users/mfn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfn/subscriptions","organizations_url":"https://api.github.com/users/mfn/orgs","repos_url":"https://api.github.com/users/mfn/repos","events_url":"https://api.github.com/users/mfn/events{/privacy}","received_events_url":"https://api.github.com/users/mfn/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T18:00:12Z","updated_at":"2016-02-05T18:00:12Z","body":"@Xenopathic Thank you very much for this fix!\r\n\r\nIt was the cause of problems I was seeing with my [nginx/fpm php7 setup and chunked-encoding](http://stackoverflow.com/questions/34440220/post-request-to-php7-with-chunked-encoding-does-not-properly-return-result).\r\n\r\nThe 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 .\r\n\r\nFor full disclosure: prior to this fix, with a simple script like this:\r\n```PHP\r\n<?php\r\necho str_repeat('.', 512);\r\n```\r\nand this curl command:\r\n`curl -XPOST http://localhost/ -H \"Transfer-Encoding: chunked\" -d ''`\r\nthe following would have been returned:\r\n`curl: (18) transfer closed with outstanding read data remaining`\r\n\r\nAlso nginx would show:\r\n`readv() failed (104: Connection reset by peer) while reading upstream`\r\n\r\nSo, again, thanks :-)"}}