Hi Johannes, > thanks for the patch, next to platform specific stuff I'm wondering > whether the shutdown order is right: > [..snip..] > Destructors can be PHP code, as can some ob callback so I think the order > should be changed.
Yes, great catch, the order is incorrect. We use a different order internally that didn¹t translate properly when I merged to php 5.3. My goal is to have the unset be as high as possible in the shutdown after all possible userspace code is executed as well as response is sent but before any real executor teardown starts happening. I¹ve updated the patch attached to the rfc which moves the timeout unset in php_request_shutdown from #2, after php_call_shutdown_functions to #5, after sapi_send_headers. Does this seem better? > /* 4. Send the set HTTP headers (note: This must be done AFTER > php_end_ob_buffers() !!) */ > zend_try { > sapi_send_headers(TSRMLS_C); > } zend_end_try(); > > /* 5. Reset max_execution_time (no longer executing php code after response > sent) */ > zend_try { > zend_unset_timeout(TSRMLS_C); > } zend_end_try(); > > /* 6. Call all extensions RSHUTDOWN functions */ > if (PG(modules_activated)) { > zend_deactivate_modules(TSRMLS_C); > php_free_shutdown_functions(TSRMLS_C); > } -lucas