rasmus Sat Dec 4 02:16:44 2004 EDT Modified files: /php-src NEWS /php-src/sapi/apache php_apache.c Log: Add apache_reset_timeout() function for Apache1. This is needed because Apache1 only resets the write timer, which defaults to 300 seconds, on a successful write. That is, if the client has gone away and Apache attempts a write which fails it will set the conn->aborted flag but not reset the timeout. Assuming the PHP script is running in ignore_user_abort mode we ignore the aborted flag, but we'll still get blown out of the water 300 seconds after the failed write unless we periodically reset the timer. With set_time_limit(0), ignore_user_abort(true) and periodic apache_reset_timeout() calls we can theoretically run forever which is why I disabled this call in safe mode. http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1824&r2=1.1825&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1824 php-src/NEWS:1.1825 --- php-src/NEWS:1.1824 Sat Nov 27 05:16:13 2004 +++ php-src/NEWS Sat Dec 4 02:16:44 2004 @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5.1.0 +- Add apache_reset_timeout() Apache1 function. (Rasmus) - Make request start time be available via $_SERVER['REQUEST_TIME']. (Ilia) - Allow gettimeofday() return a float if optional argument is specified. (Ilia) - Added sqlite_fetch_column_types() 3rd argument for arrays. (Ilia) http://cvs.php.net/diff.php/php-src/sapi/apache/php_apache.c?r1=1.86&r2=1.87&ty=u Index: php-src/sapi/apache/php_apache.c diff -u php-src/sapi/apache/php_apache.c:1.86 php-src/sapi/apache/php_apache.c:1.87 --- php-src/sapi/apache/php_apache.c:1.86 Thu Jan 8 03:18:03 2004 +++ php-src/sapi/apache/php_apache.c Sat Dec 4 02:16:44 2004 @@ -17,7 +17,7 @@ | David Sklar <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_apache.c,v 1.86 2004/01/08 08:18:03 andi Exp $ */ +/* $Id: php_apache.c,v 1.87 2004/12/04 07:16:44 rasmus Exp $ */ #include "php_apache_http.h" @@ -47,6 +47,7 @@ PHP_FUNCTION(apache_setenv); PHP_FUNCTION(apache_get_version); PHP_FUNCTION(apache_get_modules); +PHP_FUNCTION(apache_reset_timeout); PHP_MINFO_FUNCTION(apache); @@ -536,6 +537,20 @@ } /* }}} */ +/* {{{ proto array apache_reset_timeout(void) + Reset the Apache write timer */ +PHP_FUNCTION(apache_reset_timeout) +{ + if (PG(safe_mode)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode"); + RETURN_FALSE; + } + + ap_reset_timeout((request_rec *)SG(server_context)); + RETURN_TRUE; +} +/* }}} */ + /* * Local variables: * tab-width: 4
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php