--- sapi/apache/config.m4.orig Fri Dec 8 13:31:50 2000 +++ sapi/apache/config.m4 Fri Dec 8 13:31:50 2000 @@ -233,6 +233,15 @@ INSTALL_IT=$APACHE_INSTALL fi +AC_ARG_WITH(apache_child_terminate,[],[enable_apache_child_terminate=$withval]) + +PHP_ARG_ENABLE(apache_child_terminate,whether to compile support for ap_child_terminate, +[ --enable-apache-child-terminate Enable apache_child_terminate to terminate apache child after current request]) + +if test "$PHP_APACHE_CHILD_TERMINATE" = "yes"; then + AC_DEFINE(USE_AP_CHILD_TERMINATE,1,[ ]) +fi + dnl ## Local Variables: dnl ## tab-width: 4 dnl ## End: --- sapi/apache/mod_php4.h.orig Fri Dec 8 13:31:50 2000 +++ sapi/apache/mod_php4.h Fri Dec 8 13:31:50 2000 @@ -31,6 +31,9 @@ long last_modified; char *dav_script; long xbithack; +#ifdef USE_AP_CHILD_TERMINATE + long childterminate; +#endif } php_apache_info_struct; extern zend_module_entry apache_module_entry; --- sapi/apache/php_apache.c.orig Fri Dec 8 13:31:50 2000 +++ sapi/apache/php_apache.c Fri Dec 8 13:31:50 2000 @@ -59,6 +59,9 @@ PHP_FUNCTION(virtual); PHP_FUNCTION(getallheaders); PHP_FUNCTION(apachelog); +#ifdef USE_AP_CHILD_TERMINATE +PHP_FUNCTION(apache_child_terminate); +#endif PHP_FUNCTION(apache_note); PHP_FUNCTION(apache_lookup_uri); @@ -67,6 +70,9 @@ function_entry apache_functions[] = { PHP_FE(virtual, NULL) PHP_FE(getallheaders, NULL) +#ifdef USE_AP_CHILD_TERMINATE + PHP_FE(apache_child_terminate, NULL) +#endif PHP_FE(apache_note, NULL) PHP_FE(apache_lookup_uri, NULL) {NULL, NULL, NULL} @@ -105,6 +111,9 @@ } PHP_INI_BEGIN() +#ifdef USE_AP_CHILD_TERMINATE + PHP_INI_ENTRY1("childterminate", "0", PHP_INI_SYSTEM, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, childterminate)) +#endif PHP_INI_ENTRY1("xbithack", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, xbithack)) PHP_INI_ENTRY1("engine", "1", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, engine)) PHP_INI_ENTRY1("last_modified", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, last_modified)) @@ -130,6 +139,21 @@ "apache", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), STANDARD_MODULE_PROPERTIES }; + +/* {{{ proto string child_terminate() + Get and set Apache request notes */ +#ifdef USE_AP_CHILD_TERMINATE +PHP_FUNCTION(apache_child_terminate) +{ + if (php_apache_info.childterminate != 0) { + ap_child_terminate( ((request_rec *)SG(server_context)) ); + } else { // tell them to get lost! + php_error(E_WARNING, "apache_child_terminate disabled here"); + } +} +#endif +/* }}} */ + /* {{{ proto string apache_note(string note_name [, string note_value]) Get and set Apache request notes */ PHP_FUNCTION(apache_note) @@ -208,7 +232,9 @@ php_info_print_table_row(2, "Timeouts", output_buf); #if !defined(WIN32) && !defined(WINNT) php_info_print_table_row(2, "Server Root", server_root); - +#ifdef USE_AP_CHILD_TERMINATE + php_info_print_table_row(2, "Child Terminate", (php_apache_info.childterminate)?("Allowed here"):("Ignored here")); +#endif strcpy(modulenames, ""); for(modp = top_module; modp; modp = modp->next) { strlcpy(name, modp->name, sizeof(name));