summaryrefslogtreecommitdiff
path: root/sapi/cgi/fastcgi.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-09-11 07:22:40 +0000
committerDmitry Stogov <dmitry@php.net>2006-09-11 07:22:40 +0000
commit567a4785b315c3d009663831ef3d3dac15e566c0 (patch)
treec419c851e0319fa7ff58ecdb08b0b2f95946668b /sapi/cgi/fastcgi.c
parentf739a43906d08e2d7ef4ad5f24e624d0ff7975af (diff)
downloadphp-git-567a4785b315c3d009663831ef3d3dac15e566c0.tar.gz
Don't try to do safe connection close in case of FastCGI protocol error
Diffstat (limited to 'sapi/cgi/fastcgi.c')
-rw-r--r--sapi/cgi/fastcgi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index ae57779b7c..4a2a73623d 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -611,10 +611,12 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
RevertToSelf();
}
#else
- char buf[8];
+ if (!force) {
+ char buf[8];
- shutdown(req->fd, 1);
- while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ shutdown(req->fd, 1);
+ while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ }
close(req->fd);
#endif
req->fd = -1;