mirror of
https://github.com/php/php-src.git
synced 2026-04-12 02:23:18 +02:00
Safer shutdown process. Continue to shut down even if we bail out in the middle of a certain part.
This commit is contained in:
35
main/main.c
35
main/main.c
@@ -636,28 +636,43 @@ void php_request_shutdown(void *dummy)
|
||||
SLS_FETCH();
|
||||
PLS_FETCH();
|
||||
|
||||
if (setjmp(EG(bailout))!=0) {
|
||||
return;
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
sapi_send_headers();
|
||||
}
|
||||
|
||||
sapi_send_headers();
|
||||
php_end_ob_buffers(SG(request_info).headers_only?0:1);
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
php_end_ob_buffers(SG(request_info).headers_only?0:1);
|
||||
}
|
||||
|
||||
php_call_shutdown_functions();
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
php_call_shutdown_functions();
|
||||
}
|
||||
|
||||
if (PG(modules_activated)) {
|
||||
zend_deactivate_modules();
|
||||
}
|
||||
|
||||
php_ini_rshutdown();
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
php_ini_rshutdown();
|
||||
}
|
||||
|
||||
zend_deactivate(CLS_C ELS_CC);
|
||||
sapi_deactivate(SLS_C);
|
||||
|
||||
shutdown_memory_manager(CG(unclean_shutdown), 0);
|
||||
zend_unset_timeout();
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
sapi_deactivate(SLS_C);
|
||||
}
|
||||
|
||||
global_unlock();
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
shutdown_memory_manager(CG(unclean_shutdown), 0);
|
||||
}
|
||||
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
zend_unset_timeout();
|
||||
}
|
||||
|
||||
if (setjmp(EG(bailout)==0) {
|
||||
global_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user