summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2016-01-29 15:14:08 +0000
committerXinchen Hui <laruence@gmail.com>2016-01-29 20:36:52 -0800
commit7806553fd39f9c972bf2204f62e67fa45730cde9 (patch)
treed8e379fa97e83132ebfa273fca7e968cb1558bdb
parentae122bf7adf4f8b2df6b5acf316d16112587d921 (diff)
downloadphp-git-7806553fd39f9c972bf2204f62e67fa45730cde9.tar.gz
Properly read any remaining data when closing FastCGI socket
-rw-r--r--main/fastcgi.c6
1 files changed, 3 insertions, 3 deletions
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