diff options
Diffstat (limited to 'main/fastcgi.c')
| -rw-r--r-- | main/fastcgi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/fastcgi.c b/main/fastcgi.c index 54ba36b7db..ce33369045 100644 --- a/main/fastcgi.c +++ b/main/fastcgi.c @@ -1277,21 +1277,21 @@ void fcgi_close(fcgi_request *req, int force, int destroy) DisconnectNamedPipe(pipe); } 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) {} } closesocket(req->fd); } #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 |
