From: Zeev Suraski Date: Thu, 19 Sep 2002 15:58:01 +0000 (+0000) Subject: MFZE1 - connection_status() fix X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~286 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd115087e39a7dd3fbacc4a6ffb4e7b9c0dbf2b5;p=php MFZE1 - connection_status() fix --- diff --git a/Zend/zend.c b/Zend/zend.c index c47d1e223d..3a655f4ce9 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -52,6 +52,8 @@ ZEND_API void (*zend_unblock_interruptions)(void); ZEND_API void (*zend_ticks_function)(int ticks); ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); +void (*zend_on_timeout)(int seconds TSRMLS_DC); + static void (*zend_message_dispatcher_p)(long message, void *data); static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents); @@ -423,6 +425,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i zend_unblock_interruptions = utility_functions->unblock_interruptions; zend_get_configuration_directive_p = utility_functions->get_configuration_directive; zend_ticks_function = utility_functions->ticks_function; + zend_on_timeout = utility_functions->on_timeout; zend_compile_file = compile_file; zend_execute = execute; diff --git a/Zend/zend.h b/Zend/zend.h index ed1beb0637..4901f468ac 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -337,6 +337,7 @@ typedef struct _zend_utility_functions { void (*unblock_interruptions)(void); int (*get_configuration_directive)(char *name, uint name_length, zval *contents); void (*ticks_function)(int ticks); + void (*on_timeout)(int seconds TSRMLS_DC); } zend_utility_functions; @@ -465,6 +466,7 @@ extern ZEND_API void (*zend_block_interruptions)(void); extern ZEND_API void (*zend_unblock_interruptions)(void); extern ZEND_API void (*zend_ticks_function)(int ticks); extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); +extern void (*zend_on_timeout)(int seconds TSRMLS_DC); ZEND_API void zend_error(int type, const char *format, ...); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 5b452d6e3f..e3903e291b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -836,11 +836,11 @@ ZEND_API void zend_timeout(int dummy) { TSRMLS_FETCH(); - /* is there any point in this? we're terminating the request anyway... - PG(connection_status) |= PHP_CONNECTION_TIMEOUT; - */ zend_error(E_ERROR, "Maximum execution time of %d second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s"); + if (zend_on_timeout) { + zend_on_timeout(EG(timeout_seconds) TSRMLS_CC); + } }