Merge branch 'PHP-7.2' into PHP-7.3

This commit is contained in:
George Wang 2019-11-21 17:58:16 -05:00
commit e981f5af51

View file

@ -610,7 +610,7 @@ static int sapi_lsapi_activate()
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
"LiteSpeed V7.5",
"LiteSpeed V7.6",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
@ -691,6 +691,8 @@ static void lsapi_sigsegv( int signal )
_exit(1);
}
static int do_clean_shutdown = 1;
static int clean_onexit = 1;
@ -766,6 +768,7 @@ static int lsapi_module_main(int show_source)
return -1;
}
if (do_clean_shutdown) {
sigemptyset(&act.sa_mask);
act.sa_flags = SA_NODEFER;
act.sa_handler = lsapi_sigterm;
@ -778,6 +781,7 @@ static int lsapi_module_main(int show_source)
sa_rc = sigaction( SIGTERM, &act, NULL);
clean_onexit = 0;
}
if (show_source) {
zend_syntax_highlighter_ini syntax_highlighter_ini;
@ -1585,6 +1589,7 @@ int main( int argc, char * argv[] )
int result;
if (do_clean_shutdown)
atexit(lsapi_atexit);
while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) {
@ -1659,6 +1664,13 @@ static PHP_MINIT_FUNCTION(litespeed)
if (p && 0 == strcasecmp(p, "on"))
parse_user_ini = 1;
p = getenv("LSAPI_CLEAN_SHUTDOWN");
if (p) {
if (*p == '1' || 0 == strcasecmp(p, "on"))
do_clean_shutdown = 1;
else if (*p == '0' || 0 == strcasecmp(p, "off"))
do_clean_shutdown = 0;
}
/*
* mod_lsapi always sets this env var,
* so we can detect mod_lsapi mode with its presense.