]> 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:13 +0000 (09:08 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 21 May 2007 09:08:13 +0000 (09:08 +0000)
sapi/cgi/cgi_main.c
sapi/cgi/fastcgi.c
sapi/cgi/fastcgi.h

index 4f28378e6ac0f79f5307606024ba19c3686a7f1a..fc21964482755362ad317d5613d50e0bbf27ac6b 100644 (file)
@@ -1429,6 +1429,9 @@ consult the installation file that came with this distribution, or visit \n\
                        switch (c) {
                                case 'h':
                                case '?':
+#if PHP_FASTCGI
+                                       fcgi_shutdown();
+#endif
                                        no_headers = 1;
                                        php_output_startup();
                                        php_output_activate(TSRMLS_C);
@@ -1823,6 +1826,7 @@ fastcgi_request_done:
                        }
                        /* end of fastcgi loop */
                }
+               fcgi_shutdown();
 #endif
 
                if (cgi_sapi_module.php_ini_path_override) {
index 950b22679070892f7395d8b6f51f1ff7b533db32..5d2cdbc7d3a5385180eb30692e3d8d2f775a75d5 100644 (file)
@@ -255,6 +255,11 @@ int fcgi_is_fastcgi(void)
        }
 }
 
+void fcgi_shutdown(void)
+{
+       is_fastcgi = 0;
+}
+
 #ifdef _WIN32
 /* Do some black magic with the NT security API.
  * We prepare a DACL (Discretionary Access Control List) so that
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);