cvs: /php4 main.c php_globals.h
| From: | Rasmus Lerdorf | Date: | Fri, 03 Dec 1999 05:03:46 +0000 |
| Subject: | cvs: /php4 main.c php_globals.h | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7302@lists.php.net to get a copy of this message | ||
rasmus Fri Dec 3 00:03:46 1999 EDT
Modified files:
/php4 main.c php_globals.h
Log:
@ 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
Index: php4/main.c
diff -u php4/main.c:1.143 php4/main.c:1.144
--- php4/main.c:1.143 Thu Dec 2 15:00:16 1999
+++ php4/main.c Fri Dec 3 00:03:15 1999
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.143 1999/12/02 20:00:16 rasmus Exp $ */
+/* $Id: main.c,v 1.144 1999/12/03 05:03:15 rasmus Exp $ */
#include <stdio.h>
@@ -129,12 +129,14 @@
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;
}
@@ -739,6 +741,8 @@
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: php4/php_globals.h
diff -u php4/php_globals.h:1.28 php4/php_globals.h:1.29
--- php4/php_globals.h:1.28 Wed Dec 1 12:07:54 1999
+++ php4/php_globals.h Fri Dec 3 00:03:16 1999
@@ -89,6 +89,8 @@
short connection_status;
short ignore_user_abort;
+ long max_execution_time;
+
unsigned char header_is_being_sent;
zend_llist ll_post_request_startup;