]> granicus.if.org Git - php/commitdiff
iFixed several small FastCGI releated bugs
authorDmitry Stogov <dmitry@php.net>
Fri, 3 Feb 2006 16:31:09 +0000 (16:31 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 3 Feb 2006 16:31:09 +0000 (16:31 +0000)
sapi/cgi/cgi_main.c

index d1a116c67c261ceb347ad17c74b1ccf9d74ad1d6..5efda508ea940fd000679b9611c014f51a703e19 100644 (file)
@@ -281,7 +281,7 @@ static void sapi_cgibin_flush(void *server_context)
 #ifndef PHP_WIN32
                !parent && 
 #endif
-               (!request || FCGX_FFlush(request->out) == -1)) {
+               request && FCGX_FFlush(request->out) == -1) {
                        php_handle_aborted_connection();
                }
                return;
@@ -1260,7 +1260,8 @@ consult the installation file that came with this distribution, or visit \n\
                                fprintf( stderr, "Wait for kids, pid %d\n",
                                         getpid() );
 #endif
-                               wait( &status );
+                               while (wait( &status ) < 0) {
+                               }
                                running--;
                        }
                }
@@ -1688,6 +1689,7 @@ fastcgi_request_done:
                exit_status = 255;
        } zend_end_try();
 
+       SG(server_context) = NULL;
        php_module_shutdown(TSRMLS_C);
 
 #ifdef ZTS