diff options
| author | Dmitry Stogov <dmitry@php.net> | 2007-05-21 09:08:13 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2007-05-21 09:08:13 +0000 |
| commit | 23409a4bbfe61c36f799968866c6d35fc1fd216a (patch) | |
| tree | fc6558da5c0fa836e13614b1db4a9fbdee644b20 /sapi | |
| parent | 3040a34b21ebfdcfe5fa1a2102cf0b7eba8fe5fe (diff) | |
| download | php-git-23409a4bbfe61c36f799968866c6d35fc1fd216a.tar.gz | |
Fixed crash on "php -b 1234 -unknown-option"
Diffstat (limited to 'sapi')
| -rw-r--r-- | sapi/cgi/cgi_main.c | 4 | ||||
| -rw-r--r-- | sapi/cgi/fastcgi.c | 5 | ||||
| -rw-r--r-- | sapi/cgi/fastcgi.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 4f28378e6a..fc21964482 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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) { diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c index 950b226790..5d2cdbc7d3 100644 --- a/sapi/cgi/fastcgi.c +++ b/sapi/cgi/fastcgi.c @@ -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 diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h index a2fede78c2..1da8b05953 100644 --- a/sapi/cgi/fastcgi.h +++ b/sapi/cgi/fastcgi.h @@ -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); |
