diff -Nru apache_1.3.12/htdocs/manual/mod/directives.html apache_1.3.12.new/htdocs/manual/mod/directives.html --- apache_1.3.12/htdocs/manual/mod/directives.html Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/htdocs/manual/mod/directives.html Mon Mar 13 19:29:56 2000 @@ -99,6 +99,7 @@
+ + ++ + + diff -Nru apache_1.3.12/src/ApacheCore.def apache_1.3.12.new/src/ApacheCore.def --- apache_1.3.12/src/ApacheCore.def Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/src/ApacheCore.def Mon Mar 13 19:30:30 2000 @@ -360,3 +360,17 @@ ap_SHA1Final @355 ap_sha1_base64 @356 ap_send_error_response @357 + ap_add_config_define @358 + ap_global_ctx @359 + ap_ctx_new @360 + ap_ctx_get @361 + ap_ctx_set @362 + ap_hook_init @363 + ap_hook_kill @364 + ap_hook_configure @365 + ap_hook_register_I @366 + ap_hook_unregister_I @367 + ap_hook_status @368 + ap_hook_use @369 + ap_hook_call @370 + diff -Nru apache_1.3.12/src/Configuration.tmpl apache_1.3.12.new/src/Configuration.tmpl --- apache_1.3.12/src/Configuration.tmpl Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/src/Configuration.tmpl Mon Mar 13 19:39:11 2000 @@ -68,6 +68,24 @@ #TARGET= ################################################################ +# Extended API (EAPI) support: +# +# EAPI: +# The EAPI rule enables more module hooks, a generic low-level hook +# mechanism, a generic context mechanism and shared memory based pools. +# +# EAPI_MM: +# Set the EAPI_MM variable to either the directory of a MM Shared Memory +# Library source tree or the installation tree of MM. Alternatively you can +# also use the value 'SYSTEM' which then indicates that MM is installed +# under various system locations. When the MM library files cannot be found +# the EAPI still can be built, but without shared memory pool support, of +# course. + +Rule EAPI=no +#EAPI_MM=SYSTEM + +################################################################ # Dynamic Shared Object (DSO) support # # There is experimental support for compiling the Apache core and @@ -242,6 +260,11 @@ ## it does not do per-request stuff. AddModule modules/standard/mod_env.o + +## mod_define expands variables on arbitrary directive lines. +## It requires Extended API (EAPI). + +# AddModule modules/extra/mod_define.o ## ## Request logging modules diff -Nru apache_1.3.12/src/Configure apache_1.3.12.new/src/Configure --- apache_1.3.12/src/Configure Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/src/Configure Mon Mar 13 19:30:30 2000 @@ -1727,6 +1727,72 @@ fi #################################################################### +## Extended API (EAPI) support: +## +if [ "x$RULE_EAPI" = "x" ]; then + RULE_EAPI=`./helpers/CutRule EAPI $file` +fi +if [ "x$RULE_EAPI" = "xyes" ]; then + echo " + enabling Extended API (EAPI)" + CFLAGS="$CFLAGS -DEAPI" + # some vendor compilers are too restrictive + # for our ap_hook and ap_ctx sources. + case "$OS:$CC" in + *IRIX-32*:*/cc|*IRIX-32*:cc ) + CFLAGS="$CFLAGS -woff 1048,1110,1164" + ;; + esac + # MM Shared Memory Library support for EAPI + if [ "x$EAPI_MM" = "x" ]; then + EAPI_MM=`egrep '^EAPI_MM=' $file | tail -1 | awk -F= '{print $2}'` + fi + if [ "x$EAPI_MM" != "x" ]; then + case $EAPI_MM in + SYSTEM|/* ) ;; + * ) for p in . .. ../..; do + if [ -d "$p/$EAPI_MM" ]; then + EAPI_MM="`echo $p/$EAPI_MM | sed -e 's;/\./;/;g'`" + break + fi + done + ;; + esac + if [ "x$EAPI_MM" = "xSYSTEM" ]; then + echo " using MM library for EAPI: (system-wide)" + CFLAGS="$CFLAGS -DEAPI_MM" + __INCLUDES="`mm-config --cflags`" + if [ "x$__INCLUDES" != "x-I/usr/include" ]; then + INCLUDES="$INCLUDES $__INCLUDES" + fi + LDFLAGS="$LDFLAGS `mm-config --ldflags`" + LIBS="$LIBS `mm-config --libs`" + else + if [ -f "$EAPI_MM/.libs/libmm.a" -a -f "$EAPI_MM/mm.h" ]; then + echo " using MM library: $EAPI_MM (source-tree only)" + case $EAPI_MM in + /* ) ;; + * ) EAPI_MM="\$(SRCDIR)/$EAPI_MM" ;; + esac + CFLAGS="$CFLAGS -DEAPI_MM" + INCLUDES="$INCLUDES -I$EAPI_MM" + LDFLAGS="$LDFLAGS -L$EAPI_MM/.libs" + LIBS="$LIBS -lmm" + elif [ -f "$EAPI_MM/bin/mm-config" ]; then + echo " using MM library: $EAPI_MM (installed)" + CFLAGS="$CFLAGS -DEAPI_MM" + INCLUDES="$INCLUDES `$EAPI_MM/bin/mm-config --cflags`" + LDFLAGS="$LDFLAGS `$EAPI_MM/bin/mm-config --ldflags`" + LIBS="$LIBS `$EAPI_MM/bin/mm-config --libs`" + else + echo "Configure:Error: Cannot find MM library under $EAPI_MM" 1>&2 + exit 1 + fi + fi + fi +fi + + +#################################################################### ## Add in the Expat library if needed/wanted. ## if [ -d ./lib/expat-lite/ ]; then diff -Nru apache_1.3.12/src/ap/Makefile.tmpl apache_1.3.12.new/src/ap/Makefile.tmpl --- apache_1.3.12/src/ap/Makefile.tmpl Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/src/ap/Makefile.tmpl Mon Mar 13 19:30:30 2000 @@ -6,7 +6,8 @@ LIB=libap.a OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o ap_signal.o \ - ap_slack.o ap_snprintf.o ap_sha1.o ap_checkpass.o ap_base64.o + ap_slack.o ap_snprintf.o ap_sha1.o ap_checkpass.o ap_base64.o \ + ap_hook.o ap_ctx.o ap_mm.o .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $< diff -Nru apache_1.3.12/src/ap/ap.mak apache_1.3.12.new/src/ap/ap.mak --- apache_1.3.12/src/ap/ap.mak Mon Mar 13 19:38:44 2000 +++ apache_1.3.12.new/src/ap/ap.mak Mon Mar 13 19:30:30 2000 @@ -47,6 +47,9 @@ -@erase "$(INTDIR)\ap_cpystrn.obj" -@erase "$(INTDIR)\ap_fnmatch.obj" -@erase "$(INTDIR)\ap_md5c.obj" + -@erase "$(INTDIR)\ap_hook.obj" + -@erase "$(INTDIR)\ap_ctx.obj" + -@erase "$(INTDIR)\ap_mm.obj" -@erase "$(INTDIR)\ap_signal.obj" -@erase "$(INTDIR)\ap_slack.obj" -@erase "$(INTDIR)\ap_snprintf.obj" @@ -105,6 +108,9 @@ "$(INTDIR)\ap_cpystrn.obj" \ "$(INTDIR)\ap_fnmatch.obj" \ "$(INTDIR)\ap_md5c.obj" \ + "$(INTDIR)\ap_hook.obj" \ + "$(INTDIR)\ap_ctx.obj" \ + "$(INTDIR)\ap_mm.obj" \ "$(INTDIR)\ap_signal.obj" \ "$(INTDIR)\ap_slack.obj" \ "$(INTDIR)\ap_snprintf.obj" \ @@ -139,6 +145,9 @@ -@erase "$(INTDIR)\ap_cpystrn.obj" -@erase "$(INTDIR)\ap_fnmatch.obj" -@erase "$(INTDIR)\ap_md5c.obj" + -@erase "$(INTDIR)\ap_hook.obj" + -@erase "$(INTDIR)\ap_ctx.obj" + -@erase "$(INTDIR)\ap_mm.obj" -@erase "$(INTDIR)\ap_signal.obj" -@erase "$(INTDIR)\ap_slack.obj" -@erase "$(INTDIR)\ap_snprintf.obj" @@ -197,6 +206,9 @@ "$(INTDIR)\ap_cpystrn.obj" \ "$(INTDIR)\ap_fnmatch.obj" \ "$(INTDIR)\ap_md5c.obj" \ + "$(INTDIR)\ap_hook.obj" \ + "$(INTDIR)\ap_ctx.obj" \ + "$(INTDIR)\ap_mm.obj" \ "$(INTDIR)\ap_signal.obj" \ "$(INTDIR)\ap_slack.obj" \ "$(INTDIR)\ap_snprintf.obj" \ diff -Nru apache_1.3.12/src/ap/ap_ctx.c apache_1.3.12.new/src/ap/ap_ctx.c --- apache_1.3.12/src/ap/ap_ctx.c Thu Jan 1 01:00:00 1970 +++ apache_1.3.12.new/src/ap/ap_ctx.c Thu Dec 30 22:02:56 1999 @@ -0,0 +1,155 @@ +/* ==================================================================== + * Copyright (c) 1998-2000 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see
+Module mod_define
+Variable Definition For Arbitrary Directives
+ +This module is contained in themod_define.c
file. It provides +the definition variables for arbitrary directives, i.e. variables which can be +expanded on any(!) directive line. It needs Extended API (EAPI). It is not +compiled into the server by default. To usemod_define
you have +to enable the following line in the server buildConfiguration
+file: + ++
+ AddModule modules/extra/mod_define.o ++ ++
+ +Define
+Syntax: +Define
variable value
+Default: + none
+Context: + server config, virtual host, directory, .htaccess
+Override: none
+Status: Extension
+Module: mod_define.c
+Compatibility: Apache+EAPI
+ ++The
Define
directive defines a variable which later can be +expanded with the unsafe but short construct +``$
variable'' or the safe but longer construct +``${
variable}
'' on any configuration line. +Do not intermix this with the third-party modulemod_macro
. The +mod_define
module doesn't provide a general macro mechanism, +although one can consider variable substitutions as a special form of macros. +Because the value of to which ``$
variable'' expands has +to fit into one line. When you need macros which can span more lines, you've +to usemod_macro
. OTOHmod_macro
cannot be used to +expand a variable/macro on an arbitrary directive line. So, the typical use +case ofmod_define
is to make strings variable (and this +way easily changeable at one location) and not to bundle things +together (as it's the typical use case for macros). + ++The syntax of the expansion construct ( +``
${
variable}
'') follows the Perl and Shell +syntax, but can be changed via theDefine
directive, too. Four +internal variables can be used for this. The default is: + +++ ++Define mod_define::escape "\\" +Define mod_define::dollar "$" +Define mod_define::open "{" +Define mod_define::close "}" +++When you need to escape some of the expansion constructs you place the +mod_define::escape character in front of it. The default is the backslash as +in Perl or the Shell. + +
+Example: +
++ + ++Define master "Joe Average <joe@average.dom>" +Define docroot /usr/local/apache/htdocs +Define hostname foo +Define domainname bar.dom +Define portnumber 80 + : +<VirtualHost $hostname.$domainname:$portnumber> +SetEnv SERVER_MASTER "$master" +ServerName $hostname.$domainname +ServerAlias $hostname +Port $portnumber +DocumentRoot $docroot +<Directory $docroot> + : +<Directory> ++
\n\n
Srv | " + "PID | " + "Acc | " + "M | " +#ifndef NO_TIMES + "CPU | " +#endif + "SS | " + "Req | " + "Conn | " + "Child | " + "Slot | " + "Host | " + "VHost | " + "Request | " + "
Srv | PID | Acc | M\n | SS | Req | Conn | Child | Slot | Client | VHost | Request |
---|
Srv | PID | Acc | M | CPU\n | SS | Req | Conn | Child | Slot | Client | VHost | Request |
---|---|---|---|---|---|---|---|---|---|---|---|---|
%d-%d | - | %d/%lu/%lu", + " | %d-%d | - | %d/%lu/%lu", i, (int) ps_record.generation, (int) conn_lres, my_lres, lres); else ap_rprintf(r, - " | |||||||
%d-%d | %d | %d/%lu/%lu", + " | %d-%d | %d | %d/%lu/%lu", i, (int) ps_record.generation, (int) ps_record.pid, (int) conn_lres, my_lres, lres); @@ -665,12 +691,23 @@ ap_rprintf(r, " | ? | ? | ..reading.. | %s" + " | %s" + " | %s" + "\n\n", + score_record.client, + vhost ? vhost->server_hostname : "(unavailable)", + ap_escape_html(r->pool, score_record.request)); +#else ap_rprintf(r, " | %s | %s | %s\n\n",
ap_escape_html(r->pool, score_record.client),
vhost ? ap_escape_html(r->pool,
vhost->server_hostname) : "(unavailable)",
ap_escape_html(r->pool, score_record.request));
+#endif
} /* no_table_report */
} /* !short_report */
} /* if ( |