]> granicus.if.org Git - php/commitdiff
Fixed crash on "php -b 1234 -unknown-option"
authorDmitry Stogov <dmitry@php.net>
Mon, 21 May 2007 09:08:25 +0000 (09:08 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 21 May 2007 09:08:25 +0000 (09:08 +0000)
sapi/cgi/cgi_main.c
sapi/cgi/fastcgi.c
sapi/cgi/fastcgi.h

index 2487727aaba065161a26ddc961cc245e831aa6ee..01f5ab758f893e6f644aee60783be40854e53613 100644 (file)
@@ -1369,6 +1369,7 @@ consult the installation file that came with this distribution, or visit \n\
                        switch (c) {
                                case 'h':
                                case '?':
+                                       fcgi_shutdown();
                                        no_headers = 1;
                                        php_output_tearup();
                                        SG(headers_sent) = 1;
@@ -1735,6 +1736,7 @@ fastcgi_request_done:
                        }
                        /* end of fastcgi loop */
                }
+               fcgi_shutdown();
 
                if (cgi_sapi_module.php_ini_path_override) {
                        free(cgi_sapi_module.php_ini_path_override);
index 1c62eacd8dd5415d2b9bfa94aa8b6be88e3b410b..8062e22a9dfc5c7097f624dac68e89e12b062de8 100644 (file)
@@ -177,6 +177,11 @@ int fcgi_in_shutdown(void)
        return in_shutdown;
 }
 
+void fcgi_shutdown(void)
+{
+       is_fastcgi = 0;
+}
+
 int fcgi_init(void)
 {
        if (!is_initialized) {
index a2fede78c24bfafa34c9ed699371ae30d9d3c939..1da8b05953db9548d13593d7b5e9efae5d72f4a1 100644 (file)
@@ -112,6 +112,7 @@ typedef struct _fcgi_request {
 } fcgi_request;
 
 int fcgi_init(void);
+void fcgi_shutdown(void);
 int fcgi_is_fastcgi(void);
 int fcgi_in_shutdown(void);
 int fcgi_listen(const char *path, int backlog);