summaryrefslogtreecommitdiff
path: root/sapi/cgi/fastcgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/fastcgi.c')
-rw-r--r--sapi/cgi/fastcgi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index e5fefb08cf..8d2d7a32cb 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -1084,19 +1084,21 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
DisconnectNamedPipe(pipe);
} else {
if (!force) {
- char buf[8];
+ fcgi_header buf;
shutdown(req->fd, 1);
- while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ /* read the last FCGI_STDIN header (it may be omitted) */
+ recv(req->fd, &buf, sizeof(buf), 0);
}
closesocket(req->fd);
}
#else
if (!force) {
- char buf[8];
+ fcgi_header buf;
shutdown(req->fd, 1);
- while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ /* read the last FCGI_STDIN header (it may be omitted) */
+ recv(req->fd, &buf, sizeof(buf), 0);
}
close(req->fd);
#endif