dmitry Thu Feb 15 12:33:54 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c fastcgi.c fastcgi.h Log: Fixed bug #40414 (possivle endless fork() loop when running fastcgi) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.308&r2=1.309&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.308 php-src/sapi/cgi/cgi_main.c:1.309 --- php-src/sapi/cgi/cgi_main.c:1.308 Mon Jan 29 19:38:21 2007 +++ php-src/sapi/cgi/cgi_main.c Thu Feb 15 12:33:54 2007 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.308 2007/01/29 19:38:21 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.309 2007/02/15 12:33:54 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -1338,6 +1338,10 @@ exit(1); } + if (fcgi_in_shutdown()) { + exit(0); + } + while (parent) { do { #ifdef DEBUG_FASTCGI http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.29&r2=1.30&diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.29 php-src/sapi/cgi/fastcgi.c:1.30 --- php-src/sapi/cgi/fastcgi.c:1.29 Thu Feb 15 12:05:25 2007 +++ php-src/sapi/cgi/fastcgi.c Thu Feb 15 12:33:54 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fastcgi.c,v 1.29 2007/02/15 12:05:25 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.30 2007/02/15 12:33:54 dmitry Exp $ */ #include "php.h" #include "fastcgi.h" @@ -164,6 +164,11 @@ #endif +int fcgi_in_shutdown(void) +{ + return in_shutdown; +} + int fcgi_init(void) { if (!is_initialized) { http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.h?r1=1.6&r2=1.7&diff_format=u Index: php-src/sapi/cgi/fastcgi.h diff -u php-src/sapi/cgi/fastcgi.h:1.6 php-src/sapi/cgi/fastcgi.h:1.7 --- php-src/sapi/cgi/fastcgi.h:1.6 Mon Jan 1 09:29:36 2007 +++ php-src/sapi/cgi/fastcgi.h Thu Feb 15 12:33:54 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fastcgi.h,v 1.6 2007/01/01 09:29:36 sebastian Exp $ */ +/* $Id: fastcgi.h,v 1.7 2007/02/15 12:33:54 dmitry Exp $ */ /* FastCGI protocol */ @@ -110,6 +110,7 @@ int fcgi_init(void); int fcgi_is_fastcgi(void); +int fcgi_in_shutdown(void); int fcgi_listen(const char *path, int backlog); void fcgi_init_request(fcgi_request *req, int listen_socket); int fcgi_accept_request(fcgi_request *req);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php