com php-src: Properly read any remaining data when closing FastCGI socket: main/fastcgi.c
| From: | Xinchen Hui | Date: | Fri, 29 Jan 2016 15:14:08 +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-90832@lists.php.net to get a copy of this message | ||
Commit: 4b927d4a52464382d2648cd9e6b16543ddbd99e8
Author: Robin McCorkell <rmccorkell@owncloud.com> Fri, 29 Jan 2016 15:14:08 +0000
Parents: f1dc4a4e10a97d13bacd4d27c35ce8e1eef8128f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b927d4a52464382d2648cd9e6b16543ddbd99e8
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