Browse Source

Fixed crash on "php -b 1234 -unknown-option"

experimental/5.2-WITH_DRCP
Dmitry Stogov 19 years ago
parent
commit
23409a4bbf
  1. 4
      sapi/cgi/cgi_main.c
  2. 5
      sapi/cgi/fastcgi.c
  3. 1
      sapi/cgi/fastcgi.h

4
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) {

5
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

1
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);

Loading…
Cancel
Save