From: Robin McCorkell Date: Fri, 29 Jan 2016 15:14:08 +0000 (+0000) Subject: Properly read any remaining data when closing FastCGI socket X-Git-Tag: php-7.1.0alpha2~54^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7806553fd39f9c972bf2204f62e67fa45730cde9;p=php Properly read any remaining data when closing FastCGI socket --- diff --git a/main/fastcgi.c b/main/fastcgi.c index 54ba36b7db..3ab08b625f 100644 --- a/main/fastcgi.c +++ b/main/fastcgi.c @@ -1287,11 +1287,11 @@ void fcgi_close(fcgi_request *req, int force, int destroy) } #else if (!force) { - fcgi_header buf; + char buf[8]; shutdown(req->fd, 1); - /* read the last FCGI_STDIN header (it may be omitted) */ - recv(req->fd, (char *)(&buf), sizeof(buf), 0); + /* read any remaining data, it may be omitted */ + while (recv(req->fd, buf, sizeof(buf), 0) > 0) {} } close(req->fd); #endif