]> granicus.if.org Git - php/commitdiff
Don't try to do safe connection close in case of FastCGI protocol error
authorDmitry Stogov <dmitry@php.net>
Mon, 11 Sep 2006 07:22:40 +0000 (07:22 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 11 Sep 2006 07:22:40 +0000 (07:22 +0000)
sapi/cgi/fastcgi.c

index ae57779b7cae7ce98c966d10d90bddb58c6eb9c2..4a2a73623d6df77a2dd5eb4de97500f90fe9010e 100644 (file)
@@ -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;