CVS update: php3

From: Date: Wed, 27 Jan 1999 21:55:48 +0000
Subject: CVS update: php3
Groups: php.dev 
Request: Send a blank email to php-dev+get-3755@lists.php.net to get a copy of this message
Date: Wednesday January 27, 1999 @ 16:55 Author: rasmus Update of /repository/php3 In directory asf:/home/rasmus/php3 Modified Files: ChangeLog main.c mod_php3.c mod_php3.h php.h Log Message: Add ignore_user_abort .ini/.conf directive as well as the corresponding user-level ignore_user_abort() function to let people define whether or not they want their scripts to run to completion if the user aborts. Index: php3/ChangeLog diff -c php3/ChangeLog:1.564 php3/ChangeLog:1.565 *** php3/ChangeLog:1.564 Wed Jan 27 14:45:44 1999 --- php3/ChangeLog Wed Jan 27 16:55:46 1999 *************** *** 3,8 **** --- 3,9 ---- xxx xx xxxx, Version 3.0.7 - Fix implode() bug - When imploding an array that contained unset() elements it wasn't correctly skipping past these + - Add ignore_user_abort() function and .ini/.conf directive of same name - Fix connection abort detection code - It should now work reliably with Apache. Also added a user-level connection_aborted() function designed to let people check whether the user aborted the connection in a user-level Index: php3/main.c diff -c php3/main.c:1.492 php3/main.c:1.493 *** php3/main.c:1.492 Wed Jan 27 14:18:10 1999 --- php3/main.c Wed Jan 27 16:55:47 1999 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.492 1999/01/27 19:18:10 rasmus Exp $ */ /* #define CRASH_DETECTION */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.493 1999/01/27 21:55:47 rasmus Exp $ */ /* #define CRASH_DETECTION */ *************** *** 100,106 **** #ifndef THREAD_SAFE int connection_aborted; ! int abort_shutdown_pending; int error_reporting, tmp_error_reporting; int initialized; /* keep track of which resources were successfully initialized */ static int module_initialized = 0; --- 100,106 ---- #ifndef THREAD_SAFE int connection_aborted; ! int ignore_user_abort; int error_reporting, tmp_error_reporting; int initialized; /* keep track of which resources were successfully initialized */ static int module_initialized = 0; *************** *** 442,456 **** return 0; } #if APACHE ! if ((php3_rqst->connection->aborted || GLOBAL(connection_aborted)) && !GLOBAL(abort_shutdown_pending)) { GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN; /* ! abort_shutdown_pending is used to tell phplex() that even though we know that the remote client is no longer listening to us, we still want it to continue in case we come back here as part of a registered shutdown function. Without this flag a user-registered shutdown function would never run to completion. */ ! GLOBAL(abort_shutdown_pending) = 1; return 0; } #endif --- 442,456 ---- return 0; } #if APACHE ! if ((php3_rqst->connection->aborted || GLOBAL(connection_aborted)) && !GLOBAL(ignore_user_abort)) { GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN; /* ! ignore_user_abort is used to tell phplex() that even though we know that the remote client is no longer listening to us, we still want it to continue in case we come back here as part of a registered shutdown function. Without this flag a user-registered shutdown function would never run to completion. */ ! GLOBAL(ignore_user_abort) = 1; return 0; } #endif *************** *** 626,632 **** GLOBAL(header_is_being_sent) = 0; GLOBAL(php3_track_vars) = php3_ini.track_vars; GLOBAL(connection_aborted) = 0; ! GLOBAL(abort_shutdown_pending) = 0; } if (php3_init_request_info((void *) &php3_ini)) { --- 626,632 ---- GLOBAL(header_is_being_sent) = 0; GLOBAL(php3_track_vars) = php3_ini.track_vars; GLOBAL(connection_aborted) = 0; ! GLOBAL(ignore_user_abort) = 0; } if (php3_init_request_info((void *) &php3_ini)) { *************** *** 1112,1117 **** --- 1112,1120 ---- } if (cfg_get_long("enable_dl", &php3_ini.enable_dl) == FAILURE) { php3_ini.enable_dl = 1; + } + if (cfg_get_long("ignore_user_abort", &php3_ini.ignore_user_abort) == FAILURE) { + php3_ini.ignore_user_abort = 0; } /* THREADX Will have to look into this on windows * Make a master copy to use as a basis for every per-dir config. Index: php3/mod_php3.c diff -c php3/mod_php3.c:1.88 php3/mod_php3.c:1.89 *** php3/mod_php3.c:1.88 Fri Jan 1 12:58:50 1999 --- php3/mod_php3.c Wed Jan 27 16:55:47 1999 *************** *** 27,33 **** | (with helpful hints from Dean Gaudet <dgaudet@arctic.org> | +----------------------------------------------------------------------+ */ ! /* $Id: mod_php3.c,v 1.88 1999/01/01 17:58:50 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 27,33 ---- | (with helpful hints from Dean Gaudet <dgaudet@arctic.org> | +----------------------------------------------------------------------+ */ ! /* $Id: mod_php3.c,v 1.89 1999/01/27 21:55:47 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 338,343 **** --- 338,344 ---- if (add->error_append_string != orig.error_append_string) new->error_append_string = add->error_append_string; if (add->open_basedir != orig.open_basedir) new->open_basedir = add->open_basedir; if (add->enable_dl != orig.enable_dl) new->enable_dl = add->enable_dl; + if (add->ignore_user_abort != orig.ignore_user_abort) new->ignore_user_abort = add->ignore_user_abort; if (add->asp_tags != orig.asp_tags) new->asp_tags = add->asp_tags; if (add->dav_script != orig.dav_script) new->dav_script = add->dav_script; *************** *** 399,404 **** --- 400,408 ---- case 14: conf->asp_tags = val; break; + case 15: + conf->ignore_user_abort = val; + break; } return NULL; } *************** *** 605,610 **** --- 609,615 ---- {"php3_magic_quotes_sybase", php3flaghandler, (void *)12, OR_OPTIONS, FLAG, "on|off"}, {"php3_enable_dl", php3flaghandler, (void *)13, RSRC_CONF|ACCESS_CONF, FLAG, "on|off"}, {"php3_asp_tags", php3flaghandler, (void *)14, OR_OPTIONS, FLAG, "on|off"}, + {"php3_ignore_user_abort", php3flaghandler, (void *)13, RSRC_CONF|ACCESS_CONF, FLAG, "on|off"}, {NULL} }; Index: php3/mod_php3.h diff -c php3/mod_php3.h:1.50 php3/mod_php3.h:1.51 *** php3/mod_php3.h:1.50 Fri Jan 1 12:58:51 1999 --- php3/mod_php3.h Wed Jan 27 16:55:47 1999 *************** *** 26,32 **** | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: mod_php3.h,v 1.50 1999/01/01 17:58:51 zeev Exp $ */ #ifndef _MOD_PHP3_H #define _MOD_PHP3_H --- 26,32 ---- | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: mod_php3.h,v 1.51 1999/01/27 21:55:47 rasmus Exp $ */ #ifndef _MOD_PHP3_H #define _MOD_PHP3_H *************** *** 90,95 **** --- 90,96 ---- char *error_append_string; char *open_basedir; long enable_dl; + long ignore_user_abort; char *dav_script; } php3_ini_structure; Index: php3/php.h diff -c php3/php.h:1.43 php3/php.h:1.44 *** php3/php.h:1.43 Wed Jan 27 14:18:11 1999 --- php3/php.h Wed Jan 27 16:55:47 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: php.h,v 1.43 1999/01/27 19:18:11 rasmus Exp $ */ #ifndef _PHP_H #define _PHP_H --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: php.h,v 1.44 1999/01/27 21:55:47 rasmus Exp $ */ #ifndef _PHP_H #define _PHP_H *************** *** 450,456 **** extern HashTable *active_symbol_table; extern int phplineno, current_lineno; extern int connection_aborted; ! extern int abort_shutdown_pending; extern int error_reporting,tmp_error_reporting; extern pval *data,globals; extern FunctionState function_state; --- 450,456 ---- extern HashTable *active_symbol_table; extern int phplineno, current_lineno; extern int connection_aborted; ! extern int ignore_user_abort; extern int error_reporting,tmp_error_reporting; extern pval *data,globals; extern FunctionState function_state; -- 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 (#3755) next »