com php-src: Properly read any remaining data when closing FastCGI socket: main/fastcgi.c
| From: | Xinchen Hui | Date: | Sat, 30 Jan 2016 04:36:52 +0000 |
| Subject: | com php-src: Properly read any remaining data when closing FastCGI socket: main/fastcgi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90830@lists.php.net to get a copy of this message | ||
Commit: 7806553fd39f9c972bf2204f62e67fa45730cde9
Author: Robin McCorkell <rmccorkell@owncloud.com> Fri, 29 Jan 2016 15:14:08 +0000
Committer: Xinchen Hui <laruence@gmail.com> Fri, 29 Jan 2016 20:36:52 -0800
Parents: ae122bf7adf4f8b2df6b5acf316d16112587d921
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7806553fd39f9c972bf2204f62e67fa45730cde9
Log:
Properly read any remaining data when closing FastCGI socket
Changed paths:
M main/fastcgi.c
Diff:
diff --git a/main/fastcgi.c b/main/fastcgi.c
index 54ba36b..3ab08b6 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