Browse Source

@ PHP 4 scripts will now obey the max_execution_time setting and actually

@ time out (Rasmus)
# Note that Apache clears all signal handler including SIGPROF before
# calling the content handler, so even though we set our itimer before
# this in the PHP_INI stuff, Apache kicks sand in our face and we need
# to set the timer again just before we start parsing
experimetnal/RETURN_REF_PATCH
Rasmus Lerdorf 26 years ago
parent
commit
162adb778e
  1. 4
      main/main.c
  2. 2
      main/php_globals.h

4
main/main.c

@ -129,12 +129,14 @@ static PHP_INI_MH(OnSetPrecision)
static PHP_INI_MH(OnChangeMaxExecutionTime)
{
int new_timeout;
PLS_FETCH();
if (new_value) {
new_timeout = atoi(new_value);
} else {
new_timeout = 0;
}
PG(max_execution_time) = new_timeout;
php_set_timeout(new_timeout);
return SUCCESS;
}
@ -740,6 +742,8 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
zend_activate(CLS_C ELS_CC);
sapi_activate(SLS_C);
php_set_timeout(PG(max_execution_time));
if (PG(output_buffering)) {
php_start_ob_buffering();
}

2
main/php_globals.h

@ -89,6 +89,8 @@ struct _php_core_globals {
short connection_status;
short ignore_user_abort;
long max_execution_time;
unsigned char header_is_being_sent;
zend_llist ll_post_request_startup;

Loading…
Cancel
Save