iliaa Mon Oct 21 09:09:29 2002 EDT Modified files: /php4/main main.c php_globals.h /php4 php.ini-dist php.ini-recommended Log: Fixed bug #16880. Added an ini option max_input_time that allows the user to specify how much time a script may spend parsing input data (POST, GET, etc..). Index: php4/main/main.c diff -u php4/main/main.c:1.499 php4/main/main.c:1.500 --- php4/main/main.c:1.499 Sat Oct 19 22:57:40 2002 +++ php4/main/main.c Mon Oct 21 09:09:28 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.499 2002/10/20 02:57:40 fujimoto Exp $ */ +/* $Id: main.c,v 1.500 2002/10/21 13:09:28 iliaa Exp $ */ /* {{{ includes */ @@ -251,6 +251,7 @@ STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_ALL, OnUpdateBool, html_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("xmlrpc_errors", "0", PHP_INI_SYSTEM, OnUpdateBool, xmlrpc_errors, php_core_globals, core_globals) STD_PHP_INI_ENTRY("xmlrpc_error_number", "0", PHP_INI_ALL, OnUpdateInt, xmlrpc_error_number, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("max_input_time", "0", PHP_INI_ALL, + OnUpdateInt, max_input_time, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateBool, implicit_flush, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals) @@ -835,7 +836,7 @@ zend_activate(TSRMLS_C); sapi_activate(TSRMLS_C); - zend_set_timeout(EG(timeout_seconds)); + zend_set_timeout(PG(max_input_time)); if (PG(expose_php)) { sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); @@ -1539,6 +1540,8 @@ #if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) php_mbstring_set_zend_encoding(TSRMLS_C); #endif /* ZEND_MULTIBYTE && HAVE_MBSTRING */ + zend_unset_timeout(TSRMLS_C); + zend_set_timeout(EG(timeout_seconds)); retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); if (old_primary_file_path) { Index: php4/main/php_globals.h diff -u php4/main/php_globals.h:1.82 php4/main/php_globals.h:1.83 --- php4/main/php_globals.h:1.82 Sun Sep 1 07:33:19 2002 +++ php4/main/php_globals.h Mon Oct 21 09:09:29 2002 @@ -71,6 +71,7 @@ char *safe_mode_exec_dir; long memory_limit; + long max_input_time; zend_bool track_errors; zend_bool display_errors; Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.166 php4/php.ini-dist:1.167 --- php4/php.ini-dist:1.166 Thu Oct 17 05:49:46 2002 +++ php4/php.ini-dist Mon Oct 21 09:09:29 2002 @@ -218,6 +218,7 @@ ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds +max_input_time = 60 ; Maximum amount of time each script may spend parsing request +data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.114 php4/php.ini-recommended:1.115 --- php4/php.ini-recommended:1.114 Thu Oct 17 05:49:47 2002 +++ php4/php.ini-recommended Mon Oct 21 09:09:29 2002 @@ -232,6 +232,7 @@ ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds +max_input_time = 60 ; Maximum amount of time each script may spend parsing request +data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php