]> granicus.if.org Git - php/commitdiff
@ PHP 4 scripts will now obey the max_execution_time setting and actually
authorRasmus Lerdorf <rasmus@php.net>
Fri, 3 Dec 1999 05:03:16 +0000 (05:03 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 3 Dec 1999 05:03:16 +0000 (05:03 +0000)
@ 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

main/main.c
main/php_globals.h

index 367c92ae8a3101826ff45eabd37f6e7701d0b8bb..4ea14444c5d98c25bb73b76a3f6d3625424b811d 100644 (file)
@@ -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();
        }
index 44c8cbbf055d0f46e9785804dce01fe7f6175361..b11f8a7816e78ed4156483b96f7674691ccdc3d9 100644 (file)
@@ -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;