CVS update: php3/functions

From: Date: Fri, 29 Jan 1999 02:39:52 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-3770@lists.php.net to get a copy of this message
Date: Thursday January 28, 1999 @ 21:39 Author: rasmus Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv534/functions Modified Files: basic_functions.c basic_functions.h Log Message: - Add connection_status() function. This returns the raw bitfield which indicates whether the script terminated due to a user abort, a timeout or normally. Note that if ignore_user_abort is enabled, then both the timeout state and the user abort state can be active - Add connection_timeout() function. This one can be called in a shutdown function to tell you if you got there because of a timeout Index: php3/functions/basic_functions.c diff -c php3/functions/basic_functions.c:1.255 php3/functions/basic_functions.c:1.256 *** php3/functions/basic_functions.c:1.255 Wed Jan 27 16:55:53 1999 --- php3/functions/basic_functions.c Thu Jan 28 21:39:52 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.255 1999/01/27 21:55:53 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: basic_functions.c,v 1.256 1999/01/29 02:39:52 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 316,321 **** --- 316,323 ---- PHP_FE(register_shutdown_function, NULL) PHP_FE(connection_aborted, NULL) + PHP_FE(connection_timeout, NULL) + PHP_FE(connection_status, NULL) PHP_FE(ignore_user_abort, NULL) {NULL, NULL, NULL} *************** *** 509,517 **** { TLS_VARS; ! RETVAL_LONG(GLOBAL(connection_aborted)); } /* {{{ proto int ignore_user_abort(boolean value) Set whether we want to ignore a user abort event or not */ void php3_ignore_user_abort(INTERNAL_FUNCTION_PARAMETERS) --- 511,540 ---- { TLS_VARS; ! RETVAL_LONG(GLOBAL(php_connection_status)&PHP_CONNECTION_ABORTED); } + /* }}} */ + + /* {{{ proto int connection_timeout() + Did the connection time out? */ + void php3_connection_timeout(INTERNAL_FUNCTION_PARAMETERS) + { + TLS_VARS; + + RETVAL_LONG(GLOBAL(php_connection_status)&PHP_CONNECTION_TIMEOUT); + } + /* }}} */ + /* {{{ proto int connection_status() + Return the connection status bitfield */ + void php3_connection_status(INTERNAL_FUNCTION_PARAMETERS) + { + TLS_VARS; + + RETVAL_LONG(GLOBAL(php_connection_status)); + } + /* }}} */ + /* {{{ proto int ignore_user_abort(boolean value) Set whether we want to ignore a user abort event or not */ void php3_ignore_user_abort(INTERNAL_FUNCTION_PARAMETERS) *************** *** 537,542 **** --- 560,566 ---- } RETVAL_LONG(old_setting); } + /* }}} */ /* {{{ proto int error_reporting([int level]) Set/get the current error reporting level */ *************** *** 1274,1283 **** TLS_VARS; # if MODULE_MAGIC_NUMBER > 19970110 if (rflush(GLOBAL(php3_rqst)) == -1) ! GLOBAL(connection_aborted) = 1; # else if (bflush(GLOBAL(php3_rqst)->connection->client) == -1) ! GLOBAL(connection_aborted) = 1; # endif #endif #if FHTTPD --- 1298,1307 ---- TLS_VARS; # if MODULE_MAGIC_NUMBER > 19970110 if (rflush(GLOBAL(php3_rqst)) == -1) ! GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED; # else if (bflush(GLOBAL(php3_rqst)->connection->client) == -1) ! GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED; # endif #endif #if FHTTPD Index: php3/functions/basic_functions.h diff -c php3/functions/basic_functions.h:1.38 php3/functions/basic_functions.h:1.39 *** php3/functions/basic_functions.h:1.38 Wed Jan 27 16:55:54 1999 --- php3/functions/basic_functions.h Thu Jan 28 21:39:52 1999 *************** *** 29,35 **** */ ! /* $Id: basic_functions.h,v 1.38 1999/01/27 21:55:54 rasmus Exp $ */ #ifndef _BASIC_FUNCTIONS_H #define _BASIC_FUNCTIONS_H --- 29,35 ---- */ ! /* $Id: basic_functions.h,v 1.39 1999/01/29 02:39:52 rasmus Exp $ */ #ifndef _BASIC_FUNCTIONS_H #define _BASIC_FUNCTIONS_H *************** *** 96,101 **** --- 96,103 ---- extern void php3_call_user_func(INTERNAL_FUNCTION_PARAMETERS); extern void php3_call_user_method(INTERNAL_FUNCTION_PARAMETERS); extern void php3_connection_aborted(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_connection_timeout(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_connection_status(INTERNAL_FUNCTION_PARAMETERS); extern void php3_ignore_user_abort(INTERNAL_FUNCTION_PARAMETERS); PHP_FUNCTION(register_shutdown_function); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3770) next »