summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-08-31 16:02:51 +0000
committerZeev Suraski <zeev@php.net>2000-08-31 16:02:51 +0000
commit0bc2bb05d4b0053db86f92ca23538e47637876ab (patch)
treea94e923672616114e7a7e204f42fd23ea66d018d /main
parent99af3ed8efc5f9770b1bd32fd03b0486c4dd5980 (diff)
downloadphp-git-0bc2bb05d4b0053db86f92ca23538e47637876ab.tar.gz
Safer shutdown process. Continue to shut down even if we bail out in the middle of a certain part.
Diffstat (limited to 'main')
-rw-r--r--main/main.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/main/main.c b/main/main.c
index 735d6c1b3c..a6afda0064 100644
--- a/main/main.c
+++ b/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);
+ }
+
+ if (setjmp(EG(bailout)==0) {
+ shutdown_memory_manager(CG(unclean_shutdown), 0);
+ }
- global_unlock();
+ if (setjmp(EG(bailout)==0) {
+ zend_unset_timeout();
+ }
+
+ if (setjmp(EG(bailout)==0) {
+ global_unlock();
+ }
}