mirror of
https://github.com/php/php-src.git
synced 2026-04-27 18:23:26 +02:00
Properly read any remaining data when closing FastCGI socket
This commit is contained in:
committed by
Xinchen Hui
parent
ae122bf7ad
commit
7806553fd3
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user