dmitry Wed, 25 Aug 2010 13:48:16 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=302769
Log:
Don't try to read the rest of malformed FCGI requests, close immediately. It
saves one recv() call for proper FCGI request.
Changed paths:
U php/php-src/trunk/sapi/cgi/fastcgi.c
Modified: php/php-src/trunk/sapi/cgi/fastcgi.c
===================================================================
--- php/php-src/trunk/sapi/cgi/fastcgi.c 2010-08-25 13:45:52 UTC (rev
302768)
+++ php/php-src/trunk/sapi/cgi/fastcgi.c 2010-08-25 13:48:16 UTC (rev
302769)
@@ -1084,19 +1084,21 @@
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
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php