mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Properly read any remaining data when closing FastCGI socket
This commit is contained in:
parent
ae122bf7ad
commit
7806553fd3
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue