]> git.pld-linux.org Git - packages/apache.git/commitdiff
- renamed from apache-*.patch for apache1.spec (to easily distinguish between versions)
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 12 Feb 2003 10:44:48 +0000 (10:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache-EAPI-missing_files.patch -> 1.3
    apache-EAPI_MM=SYSTEM.patch -> 1.2
    apache-EAPI_MM_CORE_PATH-correction.patch -> 1.5
    apache-PLD-nov6.patch -> 1.3
    apache-PLD.patch -> 1.4
    apache-apxs-quiet.patch -> 1.2
    apache-apxs_force_rm_cp.patch -> 1.3
    apache-buff.patch -> 1.2
    apache-db3.patch -> 1.7
    apache-errordocs.patch -> 1.5
    apache-fpic.patch -> 1.3
    apache-htdocs.patch -> 1.2
    apache-ipv6-PLD.patch -> 1.9
    apache-lookup_map_ldap.patch -> 1.2
    apache-man.patch -> 1.2
    apache-mkstemp.patch -> 1.2
    apache-mod_ssl-addon.patch -> 1.8
    apache-mod_ssl-eapi.patch -> 1.10
    apache-modules_symbols.patch -> 1.4

19 files changed:
apache-EAPI-missing_files.patch [deleted file]
apache-EAPI_MM=SYSTEM.patch [deleted file]
apache-EAPI_MM_CORE_PATH-correction.patch [deleted file]
apache-PLD-nov6.patch [deleted file]
apache-PLD.patch [deleted file]
apache-apxs-quiet.patch [deleted file]
apache-apxs_force_rm_cp.patch [deleted file]
apache-buff.patch [deleted file]
apache-db3.patch [deleted file]
apache-errordocs.patch [deleted file]
apache-fpic.patch [deleted file]
apache-htdocs.patch [deleted file]
apache-ipv6-PLD.patch [deleted file]
apache-lookup_map_ldap.patch [deleted file]
apache-man.patch [deleted file]
apache-mkstemp.patch [deleted file]
apache-mod_ssl-addon.patch [deleted file]
apache-mod_ssl-eapi.patch [deleted file]
apache-modules_symbols.patch [deleted file]

diff --git a/apache-EAPI-missing_files.patch b/apache-EAPI-missing_files.patch
deleted file mode 100644 (file)
index 33b66b1..0000000
+++ /dev/null
@@ -1,2796 +0,0 @@
-diff -Nru apache_1.3.20/src/include/ap_ctx.h apache_1.3.20.new/src/include/ap_ctx.h
---- apache_1.3.20/src/include/ap_ctx.h Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/include/ap_ctx.h     Mon Mar 12 21:00:54 2001
-@@ -0,0 +1,110 @@
-+/* ====================================================================
-+ * 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 <http://www.apache.org/>.
-+ *
-+ */
-+
-+/*
-+**  Generic Context Interface for Apache
-+**  Written by Ralf S. Engelschall <rse@engelschall.com> 
-+*/
-+
-+#ifdef EAPI
-+
-+#ifndef AP_CTX_H
-+#define AP_CTX_H
-+
-+#ifndef FALSE
-+#define FALSE 0
-+#define TRUE  !FALSE
-+#endif
-+
-+/*
-+ * Internal Context Record Definition
-+ */
-+
-+#define AP_CTX_MAX_ENTRIES 1024
-+
-+typedef struct {
-+    char *ce_key;
-+    void *ce_val;
-+} ap_ctx_entry;
-+
-+typedef struct {
-+    pool          *cr_pool;
-+    ap_ctx_entry **cr_entry;
-+} ap_ctx_rec;
-+
-+typedef ap_ctx_rec ap_ctx;
-+
-+/*
-+ * Some convinience macros for storing _numbers_ 0...n in contexts, i.e.
-+ * treating numbers as pointers but keeping track of the NULL return code of
-+ * ap_ctx_get.
-+ */
-+#define AP_CTX_NUM2PTR(n) (void *)(((unsigned long)(n))+1)
-+#define AP_CTX_PTR2NUM(p) (unsigned long)(((char *)(p))-1)
-+
-+/*
-+ * Prototypes for Context Handling Functions
-+ */
-+
-+API_EXPORT(ap_ctx *)ap_ctx_new(pool *p);
-+API_EXPORT(void)    ap_ctx_set(ap_ctx *ctx, char *key, void *val);
-+API_EXPORT(void *)  ap_ctx_get(ap_ctx *ctx, char *key);
-+API_EXPORT(ap_ctx *)ap_ctx_overlay(pool *p, ap_ctx *over, ap_ctx *base);
-+
-+#endif /* AP_CTX_H */
-+
-+#endif /* EAPI */
-diff -Nru apache_1.3.20/src/include/ap_hook.h apache_1.3.20.new/src/include/ap_hook.h
---- apache_1.3.20/src/include/ap_hook.h        Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/include/ap_hook.h    Thu Dec 30 22:02:59 1999
-@@ -0,0 +1,710 @@
-+#if 0
-+=cut
-+#endif
-+/* ====================================================================
-+ * 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 <http://www.apache.org/>.
-+ *
-+ */
-+
-+/*
-+**  Implementation of a Generic Hook Interface for Apache
-+**  Written by Ralf S. Engelschall <rse@engelschall.com> 
-+**
-+**  See POD document at end of this file for description.
-+**  View it with the command ``pod2man ap_hook.h | nroff -man | more''
-+**
-+**  Attention: This header file is a little bit tricky.
-+**             It's a combination of a C source and an embedded POD document
-+**             The purpose of this is to have both things together at one
-+**             place. So you can both pass this file to the C compiler and 
-+**             the pod2man translater.
-+*/
-+
-+#ifdef EAPI
-+
-+#ifndef AP_HOOK_H
-+#define AP_HOOK_H
-+
-+/*
-+ * Function Signature Specification:
-+ *
-+ * We encode the complete signature ingredients as a bitfield
-+ * stored in a single unsigned long integer value, which can be
-+ * constructed with AP_HOOK_SIGx(...)
-+ */
-+
-+/* the type of the signature bitfield */
-+typedef unsigned long int ap_hook_sig;
-+
-+/* the mask (bin) 111 (hex 0x7) for the triples in the bitfield */
-+#define AP_HOOK_SIG_TRIPLE_MASK  0x7
-+
-+/* the position of the triple */
-+#define AP_HOOK_SIG_TRIPLE_POS(n) ((n)*3)
-+
-+/* the constructor for triple #n with value v */
-+#define AP_HOOK_SIG_TRIPLE(n,v) \
-+        (((ap_hook_sig)(v))<<((AP_HOOK_##n)*3))
-+
-+/* the check whether triple #n in sig contains value v */
-+#define AP_HOOK_SIG_HAS(sig,n,v) \
-+        ((((ap_hook_sig)(sig))&AP_HOOK_SIG_TRIPLE(n, AP_HOOK_SIG_TRIPLE_MASK)) == (AP_HOOK_##n##_##v))
-+
-+/* utility function to get triple #n in sig */
-+#define AP_HOOK_SIG_TRIPLE_GET(sig,n) \
-+        ((((ap_hook_sig)(sig))>>AP_HOOK_SIG_TRIPLE_POS(n))&(AP_HOOK_SIG_TRIPLE_MASK))
-+
-+/* utility function to set triple #n in sig to value v */
-+#define AP_HOOK_SIG_TRIPLE_SET(sig,n,v) \
-+        ((((ap_hook_sig)(sig))&~(AP_HOOK_SIG_TRIPLE_MASK<<AP_HOOK_SIG_TRIPLE_POS(n)))|((v)<<AP_HOOK_SIG_TRIPLE_POS(n)))
-+
-+/* define the ingredients for the triple #0: id stuff */
-+#define AP_HOOK_ID          0
-+#define AP_HOOK_ID_ok       AP_HOOK_SIG_TRIPLE(ID,0)
-+#define AP_HOOK_ID_undef    AP_HOOK_SIG_TRIPLE(ID,1)
-+
-+/* define the ingredients for the triple #1: return code */
-+#define AP_HOOK_RC          1
-+#define AP_HOOK_RC_void     AP_HOOK_SIG_TRIPLE(RC,0)
-+#define AP_HOOK_RC_char     AP_HOOK_SIG_TRIPLE(RC,1)
-+#define AP_HOOK_RC_int      AP_HOOK_SIG_TRIPLE(RC,2)
-+#define AP_HOOK_RC_long     AP_HOOK_SIG_TRIPLE(RC,3)
-+#define AP_HOOK_RC_float    AP_HOOK_SIG_TRIPLE(RC,4)
-+#define AP_HOOK_RC_double   AP_HOOK_SIG_TRIPLE(RC,5)
-+#define AP_HOOK_RC_ptr      AP_HOOK_SIG_TRIPLE(RC,6)
-+
-+/* define the ingredients for the triple #2: argument 1 */
-+#define AP_HOOK_A1          2
-+#define AP_HOOK_A1_ctx      AP_HOOK_SIG_TRIPLE(A1,0)
-+#define AP_HOOK_A1_char     AP_HOOK_SIG_TRIPLE(A1,1)
-+#define AP_HOOK_A1_int      AP_HOOK_SIG_TRIPLE(A1,2)
-+#define AP_HOOK_A1_long     AP_HOOK_SIG_TRIPLE(A1,3)
-+#define AP_HOOK_A1_float    AP_HOOK_SIG_TRIPLE(A1,4)
-+#define AP_HOOK_A1_double   AP_HOOK_SIG_TRIPLE(A1,5)
-+#define AP_HOOK_A1_ptr      AP_HOOK_SIG_TRIPLE(A1,6)
-+
-+/* define the ingredients for the triple #3: argument 2 */
-+#define AP_HOOK_A2          3
-+#define AP_HOOK_A2_ctx      AP_HOOK_SIG_TRIPLE(A2,0)
-+#define AP_HOOK_A2_char     AP_HOOK_SIG_TRIPLE(A2,1)
-+#define AP_HOOK_A2_int      AP_HOOK_SIG_TRIPLE(A2,2)
-+#define AP_HOOK_A2_long     AP_HOOK_SIG_TRIPLE(A2,3)
-+#define AP_HOOK_A2_float    AP_HOOK_SIG_TRIPLE(A2,4)
-+#define AP_HOOK_A2_double   AP_HOOK_SIG_TRIPLE(A2,5)
-+#define AP_HOOK_A2_ptr      AP_HOOK_SIG_TRIPLE(A2,6)
-+
-+/* define the ingredients for the triple #4: argument 3 */
-+#define AP_HOOK_A3          4
-+#define AP_HOOK_A3_ctx      AP_HOOK_SIG_TRIPLE(A3,0)
-+#define AP_HOOK_A3_char     AP_HOOK_SIG_TRIPLE(A3,1)
-+#define AP_HOOK_A3_int      AP_HOOK_SIG_TRIPLE(A3,2)
-+#define AP_HOOK_A3_long     AP_HOOK_SIG_TRIPLE(A3,3)
-+#define AP_HOOK_A3_float    AP_HOOK_SIG_TRIPLE(A3,4)
-+#define AP_HOOK_A3_double   AP_HOOK_SIG_TRIPLE(A3,5)
-+#define AP_HOOK_A3_ptr      AP_HOOK_SIG_TRIPLE(A3,6)
-+
-+/* define the ingredients for the triple #5: argument 4 */
-+#define AP_HOOK_A4          5
-+#define AP_HOOK_A4_ctx      AP_HOOK_SIG_TRIPLE(A4,0)
-+#define AP_HOOK_A4_char     AP_HOOK_SIG_TRIPLE(A4,1)
-+#define AP_HOOK_A4_int      AP_HOOK_SIG_TRIPLE(A4,2)
-+#define AP_HOOK_A4_long     AP_HOOK_SIG_TRIPLE(A4,3)
-+#define AP_HOOK_A4_float    AP_HOOK_SIG_TRIPLE(A4,4)
-+#define AP_HOOK_A4_double   AP_HOOK_SIG_TRIPLE(A4,5)
-+#define AP_HOOK_A4_ptr      AP_HOOK_SIG_TRIPLE(A4,6)
-+
-+/* define the ingredients for the triple #6: argument 5 */
-+#define AP_HOOK_A5          6
-+#define AP_HOOK_A5_ctx      AP_HOOK_SIG_TRIPLE(A5,0)
-+#define AP_HOOK_A5_char     AP_HOOK_SIG_TRIPLE(A5,1)
-+#define AP_HOOK_A5_int      AP_HOOK_SIG_TRIPLE(A5,2)
-+#define AP_HOOK_A5_long     AP_HOOK_SIG_TRIPLE(A5,3)
-+#define AP_HOOK_A5_float    AP_HOOK_SIG_TRIPLE(A5,4)
-+#define AP_HOOK_A5_double   AP_HOOK_SIG_TRIPLE(A5,5)
-+#define AP_HOOK_A5_ptr      AP_HOOK_SIG_TRIPLE(A5,6)
-+
-+/* define the ingredients for the triple #7: argument 6 */
-+#define AP_HOOK_A6          7
-+#define AP_HOOK_A6_ctx      AP_HOOK_SIG_TRIPLE(A6,0)
-+#define AP_HOOK_A6_char     AP_HOOK_SIG_TRIPLE(A6,1)
-+#define AP_HOOK_A6_int      AP_HOOK_SIG_TRIPLE(A6,2)
-+#define AP_HOOK_A6_long     AP_HOOK_SIG_TRIPLE(A6,3)
-+#define AP_HOOK_A6_float    AP_HOOK_SIG_TRIPLE(A6,4)
-+#define AP_HOOK_A6_double   AP_HOOK_SIG_TRIPLE(A6,5)
-+#define AP_HOOK_A6_ptr      AP_HOOK_SIG_TRIPLE(A6,6)
-+
-+/* define the ingredients for the triple #8: argument 7 */
-+#define AP_HOOK_A7          8
-+#define AP_HOOK_A7_ctx      AP_HOOK_SIG_TRIPLE(A7,0)
-+#define AP_HOOK_A7_char     AP_HOOK_SIG_TRIPLE(A7,1)
-+#define AP_HOOK_A7_int      AP_HOOK_SIG_TRIPLE(A7,2)
-+#define AP_HOOK_A7_long     AP_HOOK_SIG_TRIPLE(A7,3)
-+#define AP_HOOK_A7_float    AP_HOOK_SIG_TRIPLE(A7,4)
-+#define AP_HOOK_A7_double   AP_HOOK_SIG_TRIPLE(A7,5)
-+#define AP_HOOK_A7_ptr      AP_HOOK_SIG_TRIPLE(A7,6)
-+
-+/* define the ingredients for the triple #9: argument 8 */
-+#define AP_HOOK_A8          9
-+#define AP_HOOK_A8_ctx      AP_HOOK_SIG_TRIPLE(9,0)
-+#define AP_HOOK_A8_char     AP_HOOK_SIG_TRIPLE(9,1)
-+#define AP_HOOK_A8_int      AP_HOOK_SIG_TRIPLE(9,2)
-+#define AP_HOOK_A8_long     AP_HOOK_SIG_TRIPLE(9,3)
-+#define AP_HOOK_A8_float    AP_HOOK_SIG_TRIPLE(9,4)
-+#define AP_HOOK_A8_double   AP_HOOK_SIG_TRIPLE(9,5)
-+#define AP_HOOK_A8_ptr      AP_HOOK_SIG_TRIPLE(9,6)
-+  
-+/* the constructor for unknown signatures */
-+#define AP_HOOK_SIG_UNKNOWN AP_HOOK_ID_undef
-+
-+/* the constructor for signatures with 1 type */
-+#define AP_HOOK_SIG1(rc) \
-+        (AP_HOOK_RC_##rc)
-+
-+/* the constructor for signatures with 2 types */
-+#define AP_HOOK_SIG2(rc,a1) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1)
-+
-+/* the constructor for signatures with 3 types */
-+#define AP_HOOK_SIG3(rc,a1,a2) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2)
-+
-+/* the constructor for signatures with 4 types */
-+#define AP_HOOK_SIG4(rc,a1,a2,a3) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3)
-+
-+/* the constructor for signatures with 5 types */
-+#define AP_HOOK_SIG5(rc,a1,a2,a3,a4) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3|AP_HOOK_A4_##a4)
-+
-+/* the constructor for signatures with 6 types */
-+#define AP_HOOK_SIG6(rc,a1,a2,a3,a4,a5) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3|AP_HOOK_A4_##a4|AP_HOOK_A5_##a5)
-+
-+/* the constructor for signatures with 7 types */
-+#define AP_HOOK_SIG7(rc,a1,a2,a3,a4,a5,a6) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3|AP_HOOK_A4_##a4|AP_HOOK_A5_##a5|AP_HOOK_A6_##a6)
-+
-+/* the constructor for signatures with 8 types */
-+#define AP_HOOK_SIG8(rc,a1,a2,a3,a4,a5,a6,a7) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3|AP_HOOK_A4_##a4|AP_HOOK_A5_##a5|AP_HOOK_A6_##a6|AP_HOOK_A7_##a7)
-+
-+/* the constructor for signatures with 9 types */
-+#define AP_HOOK_SIG9(rc,a1,a2,a3,a4,a5,a6,a7,a8) \
-+        (AP_HOOK_RC_##rc|AP_HOOK_A1_##a1|AP_HOOK_A2_##a2|AP_HOOK_A3_##a3|AP_HOOK_A4_##a4|AP_HOOK_A5_##a5|AP_HOOK_A6_##a6|AP_HOOK_A7_##a7|AP_HOOK_A8_##a8)
-+
-+/*
-+ * Return Value Mode Identification
-+ */
-+
-+/* the type of the return value modes */
-+typedef unsigned int ap_hook_mode;
-+
-+/* the mode of the return value */
-+#define AP_HOOK_MODE_UNKNOWN  0
-+#define AP_HOOK_MODE_TOPMOST  1
-+#define AP_HOOK_MODE_DECLINE  2
-+#define AP_HOOK_MODE_DECLTMP  3
-+#define AP_HOOK_MODE_ALL      4
-+
-+/* the constructors for the return value modes */
-+#define AP_HOOK_TOPMOST       AP_HOOK_MODE_TOPMOST
-+#define AP_HOOK_DECLINE(val)  AP_HOOK_MODE_DECLINE, (val)   
-+#define AP_HOOK_DECLTMP(val)  AP_HOOK_MODE_DECLTMP, (val)   
-+#define AP_HOOK_ALL           AP_HOOK_MODE_ALL
-+
-+/*
-+ * Hook State Identification
-+ */
-+
-+/* the type of the hook state */
-+typedef unsigned short int ap_hook_state;
-+
-+/* the values of the hook state */
-+#define AP_HOOK_STATE_UNDEF       0
-+#define AP_HOOK_STATE_NOTEXISTANT 1
-+#define AP_HOOK_STATE_ESTABLISHED 2
-+#define AP_HOOK_STATE_CONFIGURED  3
-+#define AP_HOOK_STATE_REGISTERED  4
-+
-+/*
-+ * Hook Context Identification
-+ *
-+ * Notice: Null is ok here, because AP_HOOK_NOCTX is just a dummy argument
-+ *         because we know from the signature whether the argument is a
-+ *         context value or just the dummy value.
-+ */
-+
-+#define AP_HOOK_NOCTX  (void *)(0)
-+#define AP_HOOK_CTX(v) (void *)(v)
-+
-+/*
-+ * Internal Hook Record Definition
-+ */
-+
-+/* the union holding the arbitrary decline values */
-+typedef union {
-+    char   v_char;
-+    int    v_int;
-+    long   v_long;
-+    float  v_float;
-+    double v_double;
-+    void  *v_ptr;
-+} ap_hook_value;
-+
-+/* the structure holding one hook function and its context */
-+typedef struct {
-+    void *hf_ptr;              /* function pointer       */
-+    void *hf_ctx;              /* function context       */
-+} ap_hook_func;
-+
-+/* the structure holding one hook entry with all its registered functions */
-+typedef struct {
-+    char          *he_hook;    /* hook name (=unique id) */
-+    ap_hook_sig    he_sig;     /* hook signature         */
-+    int            he_modeid;  /* hook mode id           */
-+    ap_hook_value  he_modeval; /* hook mode value        */
-+    ap_hook_func **he_func;    /* hook registered funcs  */
-+} ap_hook_entry;
-+
-+/* the maximum number of hooks and functions per hook */
-+#define AP_HOOK_MAX_ENTRIES 512
-+#define AP_HOOK_MAX_FUNCS   128
-+
-+/*
-+ * Extended Variable Argument (vararg) Support
-+ *
-+ * In ANSI C varargs exists, but because the prototypes of function with
-+ * varargs cannot reflect the types of the varargs, K&R argument passing
-+ * conventions have to apply for the compiler.  This means mainly a conversion
-+ * of shorter type variants to the maximum variant (according to sizeof). The
-+ * above va_type() macro provides this mapping from the wanted types to the
-+ * physically used ones.
-+ */
-+
-+/* the mapping */
-+#define VA_TYPE_char   int
-+#define VA_TYPE_short  int
-+#define VA_TYPE_int    int
-+#define VA_TYPE_long   long
-+#define VA_TYPE_float  double
-+#define VA_TYPE_double double
-+#define VA_TYPE_ptr    void *
-+#define VA_TYPE_ctx    void *
-+
-+/* the constructor */
-+#ifdef  va_type
-+#undef  va_type
-+#endif
-+#define va_type(type)  VA_TYPE_ ## type
-+
-+/*
-+ * Miscellaneous stuff
-+ */
-+
-+#ifndef FALSE
-+#define FALSE 0
-+#define TRUE  !FALSE
-+#endif
-+
-+/*
-+ * Wrapper macros for the callback-function register/unregister calls.  
-+ * 
-+ * Background: Strict ANSI C doesn't allow a function pointer to be treated as
-+ * a void pointer on argument passing, but we cannot declare the argument as a
-+ * function prototype, because the functions can have arbitrary signatures. So
-+ * we have to use a void pointer here. But to not require explicit casts on
-+ * function pointers for every register/unregister call, we smooth the API a
-+ * little bit by providing these macros.
-+ */
-+
-+#define ap_hook_register(hook,func,ctx) ap_hook_register_I(hook,(void *)(func),ctx)
-+#define ap_hook_unregister(hook,func)   ap_hook_unregister_I(hook,(void *)(func))
-+
-+/*
-+ * Prototypes for the hook API functions
-+ */
-+
-+API_EXPORT(void)          ap_hook_init         (void);
-+API_EXPORT(void)          ap_hook_kill         (void);
-+API_EXPORT(int)           ap_hook_configure    (char *hook, ap_hook_sig sig, ap_hook_mode modeid, ...);
-+API_EXPORT(int)           ap_hook_register_I   (char *hook, void *func, void *ctx);
-+API_EXPORT(int)           ap_hook_unregister_I (char *hook, void *func);
-+API_EXPORT(ap_hook_state) ap_hook_status       (char *hook);
-+API_EXPORT(int)           ap_hook_use          (char *hook, ap_hook_sig sig, ap_hook_mode modeid, ...);
-+API_EXPORT(int)           ap_hook_call         (char *hook, ...);
-+
-+#endif /* AP_HOOK_H */
-+
-+#endif /* EAPI */
-+/*
-+=pod
-+##
-+##  Embedded POD document
-+##
-+
-+=head1 NAME
-+
-+B<ap_hook> - B<Generic Hook Interface for Apache>
-+
-+=head1 SYNOPSIS
-+
-+B<Hook Library Setup:>
-+
-+ void ap_hook_init(void);
-+ void ap_hook_kill(void);
-+
-+B<Hook Configuration and Registration:>
-+
-+ int ap_hook_configure(char *hook, ap_hook_sig sig, ap_hook_mode mode);
-+ int ap_hook_register(char *hook, void *func, void *ctx);
-+ int ap_hook_unregister(char *hook, void *func);
-+
-+B<Hook Usage:>
-+
-+ ap_hook_state ap_hook_status(char *hook);
-+ int ap_hook_use(char *hook, ap_hook_sig sig, ap_hook_mode mode, ...);
-+ int ap_hook_call(char *hook, ...);
-+
-+B<Hook Signature Constructors> (ap_hook_sig):
-+
-+ AP_HOOK_SIG1(rc)
-+ AP_HOOK_SIG2(rc,a1)
-+ AP_HOOK_SIG3(rc,a1,a2)
-+ AP_HOOK_SIG4(rc,a1,a2,a3)
-+ AP_HOOK_SIG5(rc,a1,a2,a3,a4)
-+ AP_HOOK_SIG6(rc,a1,a2,a3,a4,a5)
-+ AP_HOOK_SIG7(rc,a1,a2,a3,a4,a5,a6)
-+ AP_HOOK_SIG8(rc,a1,a2,a3,a4,a5,a6,a7)
-+
-+B<Hook Modes Constructors> (ap_hook_mode):
-+
-+ AP_HOOK_TOPMOST
-+ AP_HOOK_DECLINE(value)
-+ AP_HOOK_DECLTMP(value)
-+ AP_HOOK_ALL
-+
-+B<Hook States> (ap_hook_state):
-+
-+ AP_HOOK_STATE_UNDEF
-+ AP_HOOK_STATE_NOTEXISTANT
-+ AP_HOOK_STATE_ESTABLISHED
-+ AP_HOOK_STATE_CONFIGURED 
-+ AP_HOOK_STATE_REGISTERED
-+
-+=head1 DESCRIPTION
-+
-+This library implements a generic hook interface for Apache which can be used
-+to loosely couple code through arbitrary hooks. There are two use cases for
-+this mechanism:
-+
-+=over 3
-+
-+=item B<1. Extension and Overrides>
-+
-+Inside a specific code section you want to perform a specific function call
-+for extension reasons.  But you want to allow one or more modules to implement
-+this function by registering hooks. Those hooks are registered on a stack and
-+can be even configured to have a I<decline> return value. As long as there are
-+functions which return the decline value the next function on the stack is
-+tried. When the first function doesn't return the decline value the hook call
-+stops. 
-+
-+The original intent of this use case is to provide a flexible extension
-+mechanism where modules can override functionality.
-+
-+=item B<2. Intercommunication>
-+
-+Inside a specific code you have a function you want to export. But you first
-+want to allow other code to override this function.  And second you want to
-+export this function without real object file symbol references. Instead you
-+want to register the function and let the users call this function by name. 
-+
-+The original intent of this use case is to allow inter-module communication
-+without direct symbol references, which are a big I<no-no> for the I<Dynamic
-+Shared Object> (DSO) situation.
-+
-+=back
-+
-+And the following design goals existed:
-+
-+=over 3
-+
-+=item B<1. Minimum code changes>
-+
-+The hook calls should look very similar to the corresponding direct function
-+call to allow one to easily translate it. And the total amount of changes for
-+the hook registration, hook configuration and hook usage should be as small as
-+possible to minimize the total code changes. Additionally a shorthand API
-+function (ap_hook_use) should be provided which lets one trivially add a hook
-+by just changing the code at a single location.
-+
-+=item B<2. The hook call has to be maximum flexible>
-+
-+In order to avoid nasty hacks, maximum flexiblity for the hook calls is
-+needed, i.e. any function signature (the set of types for the return value and
-+the arguments) should be supported.  And it should be possible to
-+register always a context (ctx) variable with a function which is passed to
-+the corresponding function when the hook call is performed.
-+
-+=back
-+
-+The implementation of this library directly followed these two design goals.
-+
-+=head1 USAGE
-+
-+Using this hook API is a four-step process:
-+
-+=over 3
-+
-+=item B<1. Initialization>
-+
-+Initialize or destroy the hook mechanism inside your application program:
-+
-+ ap_hook_init();
-+    :
-+ ap_hook_kill();
-+
-+=item B<2. Configuration>
-+
-+Configure a particular hook by specifing its name, signature and return type
-+semantic:
-+
-+ ap_hook_configure("lookup", AP_HOOK_SIG2(ptr,ptr,ctx), AP_HOOK_DECLINE(NULL));
-+ ap_hook_configure("setup", AP_HOOK_SIG2(int,ptr,char), AP_HOOK_DECLTMP(FALSE));
-+ ap_hook_configure("read", AP_HOOK_SIG2(void,ptr), AP_HOOK_TOPMOST);
-+ ap_hook_configure("logit", AP_HOOK_SIG2(void,ptr), AP_HOOK_ALL);
-+
-+This configures four hooks: 
-+
-+A hook named C<lookup> with the signature C<void *lookup(void *, void *)>
-+(where the second argument is C<NULL> or the private context pointer of the
-+hook function which can be optionally provided at the registration step
-+later) and a return code semantic which says: Proceed as long as the
-+registered lookup functions return C<NULL> or no more registered functions
-+exists. A call for this hook has to provide 2 argument only (a pointer to the
-+return variable and the first argument), because the context is
-+implicitly provided by the hook mechanism. Sample idea: I<The first function
-+who was successful in looking up a variable provides the value>.
-+
-+A hook named C<setup> with the signature C<int setup(void *, char)" and a
-+return code semantic equal to the one of the C<lookup> hook. But the decline
-+return value is implemented by a temporay variable of the hook mechanism and
-+only used for the decline decision. So a call to this hook has to provide 2
-+arguments only (the first and second argument, but no address to a return
-+value). Sample idea: I<Any function can handle the setup and when one
-+function handled it stops the processing by indicating this with the return
-+value>.
-+
-+A hook named C<read> with the signature C<void read(void *)> and a return code
-+semantic which says: Only the top most function on the registered function
-+stack is tried (and independet of a possible return value in non-void
-+context). A call to this hook has to provide exactly 1 argument (the
-+single argument to the hook function). Sample idea: I<We want to
-+use a read function and allow others to override it, but independent how much
-+registered functions exists, only top most (= last registered) function
-+overrides and is used>.
-+
-+A hook named C<logit> with the signature C<void logit(void *)> and a return
-+code semantic which says: All registered functions on the hook functioin stack
-+are tried. Sample idea: I<We pass a FILE pointer to the logging functions and
-+any function can log whatever it wants>.
-+
-+=item B<3. Registration>
-+
-+Register the actual functions which should be used by the hook:
-+
-+ ap_hook_register("lookup", mylookup, mycontext);
-+ ap_hook_register("setup", mysetup);
-+ ap_hook_register("read", myread);
-+ ap_hook_register("logit", mylogit);
-+
-+This registers the function C<mylookup()> under the C<lookup> hook with the
-+private context given by the variable C<mycontext>. And it registers the
-+function C<mysetup()> under the C<setup> hook without any context. Same for
-+C<myread> and C<mylogit>.
-+
-+=item B<4. Usage>
-+
-+Finally use the hooks, i.e. instead of using direct function calls like
-+        
-+ rc = mylookup(a1, a2);
-+ rc = mysetup(a1, a2);
-+ myread(a1);
-+ mylogit(a1);
-+
-+you now use:
-+
-+ ap_hook_call("lookup", &rc, a1, a2);
-+ ap_hook_call("setup", &rc, a1, a2);
-+ ap_hook_call("read", a1);
-+ ap_hook_call("logit", a1);
-+
-+which are internally translated to:
-+
-+ rc = mylookup(a1, a2, mycontext);
-+ rc = mysetup(a1, a2);
-+ myread(a1);
-+ mylogit(a1);
-+
-+Notice two things here: First the context (C<mycontext>) for the C<mylookup()>
-+function is automatically added by the hook mechanism. And it is a different
-+(and not fixed) context for each registered function, of course.  Second,
-+return values always have to be pushed into variables and a pointer to them
-+has to be given as the second argument to C<ap_hook_call> (except for
-+functions which have a void return type, of course).
-+
-+BTW, the return value of C<ap_hook_call()> is always C<TRUE> or C<FALSE>.
-+C<TRUE> when at least one function call was successful (always the case for
-+C<AP_HOOK_TOPMOST> and C<AP_HOOK_ALL>). C<FALSE> when all functions
-+returned the decline value or no functions are registered at all.
-+
-+=back
-+
-+=head1 RESTRICTIONS
-+
-+To make the hook implementation efficient and to not bloat up the code too
-+much a few restrictions have to make:
-+
-+=over 3
-+
-+=item 1.
-+
-+Only function calls with up to 4 arguments are implemented. When more are
-+needed you can either extend the hook implementation by using more bits for
-+the signature configuration or you can do a workaround when the function is
-+your own one: Put the remaining (N-4-1) arguments into a structure and pass
-+only a pointer (one argument) as the forth argument.
-+
-+=item 2.
-+
-+Only the following ANSI C variable types are supported:
-+
-+ - For the return value: 
-+   void (= none), char, int, float, double, ptr (= void *)
-+ - For the arguments:
-+   ctx  (= context), char, int, float, double, ptr (= void *)
-+
-+This means in theory that 6^5 (=7776) signature combinations are possible. But
-+because we don't need all of them inside Apache and it would bloat up the code
-+too dramatically we implement only a subset of those combinations. The
-+implemented signatures can be specified inside C<ap_hook.c> and the
-+corresponding code can be automatically generated by running ``C<perl
-+ap_hook.c>'' (yeah, no joke ;-).  So when you need a hook with a different
-+still not implemented signature you either have to again use a workaround as
-+above (i.e. use a structure) or just add the signature to the C<ap_hook.c>
-+file.
-+
-+=head1 EXAMPLE
-+
-+We want to call `C<ssize_t read(int, void *, size_t)>' through hooks in order
-+to allow modules to override this call.  So, somewhere we have a replacement
-+function for C<read()> defined (same signature, of course):
-+
-+ ssize_t my_read(int, void *, size_t);
-+
-+We now configure a C<read> hook. Here the C<AP_HOOK_SIGx()> macro defines the
-+signature of the C<read()>-like callback functions and has to match the
-+prototype of C<read()>. But we have to replace typedefs with the physical
-+underlaying ANSI C types. And C<AP_HOOK_DECLINE()> sets the return value of
-+the read()-like functions which forces the next hook to be called (here -1).
-+And we register the original C<read()> function as the default hook.
-+
-+ ap_hook_configure("read", 
-+                   AP_HOOK_SIG4(int,int,ptr,int), 
-+                   AP_HOOK_DECLINE(-1));
-+ ap_hook_register("read", read);
-+
-+Now a module wants to override the C<read()> call and registers the
-+C<my_read()> function:
-+
-+ ap_hook_register("read", my_read);
-+
-+The function logically gets pushed onto a stack, so the execution order is the
-+reverse registering order, i.e. I<last registered - first called>. Now we can
-+replace the standard C<read()> call
-+
-+ bytes = read(fd, buf, bufsize);
-+ if (bytes == -1)
-+    ...error...
-+
-+with the hook based call:
-+
-+  rc = ap_hook_call("read", &bytes, fd, buf, bufsize);
-+  if (rc == FALSE)
-+     ...error...
-+
-+Now internally the following is done: The call `C<bytes = my_read(fd, buf,
-+bufsize)>' is done. When it returns not -1 (the decline value) nothing
-+more is done. But when C<my_read()> returns -1 the next function is tried:
-+`C<bytes = read(fd, buf, bufsize)>'. When this one also returns -1 you get
-+`rc == FALSE'. When it finally returns not -1 you get `rc == TRUE'.
-+
-+=head1 SEE ALSO
-+
-+ap_ctx(3)
-+
-+=head1 HISTORY
-+
-+The ap_hook(3) interface was originally designed and 
-+implemented in October 1998 by Ralf S. Engelschall.
-+
-+=head1 AUTHOR
-+
-+ Ralf S. Engelschall
-+ rse@engelschall.com
-+ www.engelschall.com
-+
-+=cut
-+*/
-diff -Nru apache_1.3.20/src/include/ap_mm.h apache_1.3.20.new/src/include/ap_mm.h
---- apache_1.3.20/src/include/ap_mm.h  Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/include/ap_mm.h      Thu Dec 30 22:02:59 1999
-@@ -0,0 +1,130 @@
-+/* ====================================================================
-+ * Copyright (c) 1999-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 <http://www.apache.org/>.
-+ */
-+
-+/*
-+**
-+** ap_mm.h -- wrapper code for MM shared memory library
-+**
-+*/
-+
-+#ifdef EAPI
-+
-+#ifndef AP_MM_H 
-+#define AP_MM_H 1
-+
-+#ifndef FALSE
-+#define FALSE 0
-+#define TRUE  !FALSE
-+#endif
-+
-+API_EXPORT(int) ap_mm_useable(void);
-+
-+typedef void AP_MM;
-+typedef enum { AP_MM_LOCK_RD, AP_MM_LOCK_RW } ap_mm_lock_mode;
-+
-+/* Global Malloc-Replacement API */
-+API_EXPORT(int)     ap_MM_create(size_t size, char *file);
-+API_EXPORT(int)     ap_MM_permission(mode_t mode, uid_t owner, gid_t group);
-+API_EXPORT(void)    ap_MM_destroy(void);
-+API_EXPORT(int)     ap_MM_lock(ap_mm_lock_mode mode);
-+API_EXPORT(int)     ap_MM_unlock(void);
-+API_EXPORT(void *)  ap_MM_malloc(size_t size);
-+API_EXPORT(void *)  ap_MM_realloc(void *ptr, size_t size);
-+API_EXPORT(void)    ap_MM_free(void *ptr);
-+API_EXPORT(void *)  ap_MM_calloc(size_t number, size_t size);
-+API_EXPORT(char *)  ap_MM_strdup(const char *str);
-+API_EXPORT(size_t)  ap_MM_sizeof(void *ptr);
-+API_EXPORT(size_t)  ap_MM_maxsize(void);
-+API_EXPORT(size_t)  ap_MM_available(void);
-+API_EXPORT(char *)  ap_MM_error(void);
-+
-+/* Standard Malloc-Style API */
-+API_EXPORT(AP_MM *) ap_mm_create(size_t size, char *file);
-+API_EXPORT(int)     ap_mm_permission(AP_MM *mm, mode_t mode, uid_t owner, gid_t group);
-+API_EXPORT(void)    ap_mm_destroy(AP_MM *mm);
-+API_EXPORT(int)     ap_mm_lock(AP_MM *mm, ap_mm_lock_mode mode);
-+API_EXPORT(int)     ap_mm_unlock(AP_MM *mm);
-+API_EXPORT(void *)  ap_mm_malloc(AP_MM *mm, size_t size);
-+API_EXPORT(void *)  ap_mm_realloc(AP_MM *mm, void *ptr, size_t size);
-+API_EXPORT(void)    ap_mm_free(AP_MM *mm, void *ptr);
-+API_EXPORT(void *)  ap_mm_calloc(AP_MM *mm, size_t number, size_t size);
-+API_EXPORT(char *)  ap_mm_strdup(AP_MM *mm, const char *str);
-+API_EXPORT(size_t)  ap_mm_sizeof(AP_MM *mm, void *ptr);
-+API_EXPORT(size_t)  ap_mm_maxsize(void);
-+API_EXPORT(size_t)  ap_mm_available(AP_MM *mm);
-+API_EXPORT(char *)  ap_mm_error(void);
-+API_EXPORT(void)    ap_mm_display_info(AP_MM *mm);
-+
-+/* Low-Level Shared Memory API */
-+API_EXPORT(void *)  ap_mm_core_create(size_t size, char *file);
-+API_EXPORT(int)     ap_mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group);
-+API_EXPORT(void)    ap_mm_core_delete(void *core);
-+API_EXPORT(size_t)  ap_mm_core_size(void *core);
-+API_EXPORT(int)     ap_mm_core_lock(void *core, ap_mm_lock_mode mode);
-+API_EXPORT(int)     ap_mm_core_unlock(void *core);
-+API_EXPORT(size_t)  ap_mm_core_maxsegsize(void);
-+API_EXPORT(size_t)  ap_mm_core_align2page(size_t size);
-+API_EXPORT(size_t)  ap_mm_core_align2word(size_t size);
-+
-+/* Internal Library API */
-+API_EXPORT(void)    ap_mm_lib_error_set(unsigned int, const char *str);
-+API_EXPORT(char *)  ap_mm_lib_error_get(void);
-+API_EXPORT(int)     ap_mm_lib_version(void);
-+
-+#endif /* AP_MM_H */
-+
-+#endif /* EAPI */
-+
-diff -Nru apache_1.3.20/htdocs/manual/mod/mod_define.html apache_1.3.20.new/htdocs/manual/mod/mod_define.html
---- apache_1.3.20/htdocs/manual/mod/mod_define.html    Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/htdocs/manual/mod/mod_define.html        Fri Aug 27 11:23:39 1999
-@@ -0,0 +1,135 @@
-+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-+<!--%hypertext -->
-+<!-- mod_define.html                                  -->
-+<!-- Documentation for the mod_define Apache module   -->
-+<HTML>
-+<HEAD>
-+<TITLE>Apache module mod_define</TITLE>
-+</HEAD>
-+
-+<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
-+<BODY
-+ BGCOLOR="#FFFFFF"
-+ TEXT="#000000"
-+ LINK="#0000FF"
-+ VLINK="#000080"
-+ ALINK="#FF0000"
-+>
-+<BLOCKQUOTE><!-- page indentation -->
-+<!--#include virtual="header.html" -->
-+
-+<BR>
-+<H1 ALIGN="CENTER">Module mod_define</H1>
-+<H2 ALIGN="CENTER">Variable Definition For Arbitrary Directives</H2>
-+
-+This module is contained in the <CODE>mod_define.c</CODE> 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 use <CODE>mod_define</CODE> you have
-+to enable the following line in the server build <CODE>Configuration</CODE>
-+file:
-+
-+<P>
-+<PRE>
-+    AddModule  modules/extra/mod_define.o
-+</PRE>
-+
-+<P>
-+<HR NOSHADE SIZE=1>
-+
-+<H3><A NAME="Define">Define</A></H3>
-+<A
-+ HREF="directive-dict.html#Syntax"
-+ REL="Help"
-+><STRONG>Syntax:</STRONG></A>
-+    <CODE>Define</CODE> <EM>variable</EM> <EM>value</EM><BR>
-+<A
-+ HREF="directive-dict.html#Default"
-+ REL="Help"
-+><STRONG>Default:</STRONG></A>
-+    <EM>none</EM><BR>
-+<A
-+ HREF="directive-dict.html#Context"
-+ REL="Help"
-+><STRONG>Context:</STRONG></A>
-+    server config, virtual host, directory, .htaccess<BR>
-+<A
-+ HREF="directive-dict.html#Override"
-+ REL="Help"
-+><STRONG>Override:</STRONG></A> none<BR>
-+<A
-+ HREF="directive-dict.html#Status"
-+ REL="Help"
-+><STRONG>Status:</STRONG></A> Extension<BR>
-+<A
-+ HREF="directive-dict.html#Module"
-+ REL="Help"
-+><STRONG>Module:</STRONG></A> mod_define.c<BR>
-+<A
-+ HREF="directive-dict.html#Compatibility"
-+ REL="Help"
-+><STRONG>Compatibility:</STRONG></A> Apache+EAPI<BR>
-+
-+<P>
-+The <CODE>Define</CODE> directive defines a variable which later can be
-+expanded with the unsafe but short construct
-+``<CODE>$</CODE><EM>variable</EM>'' or the safe but longer construct
-+``<CODE>${</CODE><EM>variable</EM><CODE>}</CODE>'' on any configuration line.
-+Do not intermix this with the third-party module <CODE>mod_macro</CODE>. The
-+<CODE>mod_define</CODE> 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 ``<CODE>$</CODE><EM>variable</EM>'' expands has
-+to fit into one line. When you need macros which can span more lines, you've
-+to use <CODE>mod_macro</CODE>. OTOH <CODE>mod_macro</CODE> cannot be used to
-+expand a variable/macro on an arbitrary directive line.  So, the typical use
-+case of <CODE>mod_define</CODE> is to make strings <EM>variable</EM> (and this
-+way easily changeable at one location) and not to <EM>bundle</EM> things
-+together (as it's the typical use case for macros).
-+
-+<P>
-+The syntax of the expansion construct (
-+``<CODE>${</CODE><EM>variable</EM><CODE>}</CODE>'') follows the Perl and Shell
-+syntax, but can be changed via the <CODE>Define</CODE> directive, too. Four
-+internal variables can be used for this. The default is:
-+
-+<BLOCKQUOTE>
-+<PRE>
-+Define mod_define::escape "\\"
-+Define mod_define::dollar "$"
-+Define mod_define::open   "{"
-+Define mod_define::close  "}"
-+</PRE>
-+</BLOCKQUOTE>
-+
-+<P>
-+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.
-+
-+<P>
-+<STRONG>Example:</STRONG>
-+<BLOCKQUOTE>
-+<PRE>
-+Define master     "Joe Average &lt;joe@average.dom&gt;"
-+Define docroot    /usr/local/apache/htdocs
-+Define hostname   foo
-+Define domainname bar.dom
-+Define portnumber 80
-+  :
-+&lt;VirtualHost $hostname.$domainname:$portnumber&gt;
-+SetEnv       SERVER_MASTER "$master"
-+ServerName   $hostname.$domainname
-+ServerAlias  $hostname
-+Port         $portnumber
-+DocumentRoot $docroot
-+&lt;Directory $docroot&gt;
-+  :
-+&lt;Directory&gt;
-+</PRE>
-+</BLOCKQUOTE>
-+
-+<!--#include virtual="footer.html" -->
-+</BLOCKQUOTE><!-- page indentation -->
-+</BODY>
-+</HTML>
-+<!--/%hypertext -->
-diff -Nru apache_1.3.20/src/ap/ap_ctx.c apache_1.3.20.new/src/ap/ap_ctx.c
---- apache_1.3.20/src/ap/ap_ctx.c      Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.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 <http://www.apache.org/>.
-+ *
-+ */
-+
-+/*
-+**  Generic Context Interface for Apache
-+**  Written by Ralf S. Engelschall <rse@engelschall.com> 
-+*/
-+
-+#ifdef EAPI
-+
-+#include "httpd.h"
-+#include "ap_config.h"
-+#include "ap_ctx.h"
-+
-+API_EXPORT(ap_ctx *) ap_ctx_new(pool *p)
-+{
-+    ap_ctx *ctx;
-+    int i;
-+
-+    if (p != NULL) {
-+        ctx = (ap_ctx *)ap_palloc(p, sizeof(ap_ctx_rec));
-+        ctx->cr_pool = p;
-+        ctx->cr_entry = (ap_ctx_entry **)
-+            ap_palloc(p, sizeof(ap_ctx_entry *)*(AP_CTX_MAX_ENTRIES+1));
-+    }
-+    else {
-+        ctx = (ap_ctx *)malloc(sizeof(ap_ctx_rec));
-+        ctx->cr_pool = NULL;
-+        ctx->cr_entry = (ap_ctx_entry **)
-+            malloc(sizeof(ap_ctx_entry *)*(AP_CTX_MAX_ENTRIES+1));
-+    }
-+    for (i = 0; i < AP_CTX_MAX_ENTRIES+1; i++) 
-+        ctx->cr_entry[i] = NULL;
-+    return ctx;
-+}
-+
-+API_EXPORT(void) ap_ctx_set(ap_ctx *ctx, char *key, void *val)
-+{
-+    int i;
-+    ap_ctx_entry *ce;
-+
-+    ce = NULL;
-+    for (i = 0; ctx->cr_entry[i] != NULL; i++) {
-+        if (strcmp(ctx->cr_entry[i]->ce_key, key) == 0) {
-+            ce = ctx->cr_entry[i];
-+            break;
-+        }
-+    }
-+    if (ce == NULL) {
-+        if (i == AP_CTX_MAX_ENTRIES)
-+            return;
-+        if (ctx->cr_pool != NULL) {
-+            ce = (ap_ctx_entry *)ap_palloc(ctx->cr_pool, sizeof(ap_ctx_entry));
-+            ce->ce_key = ap_pstrdup(ctx->cr_pool, key);
-+        }
-+        else {
-+            ce = (ap_ctx_entry *)malloc(sizeof(ap_ctx_entry));
-+            ce->ce_key = strdup(key);
-+        }
-+        ctx->cr_entry[i] = ce;
-+        ctx->cr_entry[i+1] = NULL;
-+    }
-+    ce->ce_val = val;
-+    return;
-+}
-+
-+API_EXPORT(void *) ap_ctx_get(ap_ctx *ctx, char *key)
-+{
-+    int i;
-+
-+    for (i = 0; ctx->cr_entry[i] != NULL; i++)
-+        if (strcmp(ctx->cr_entry[i]->ce_key, key) == 0)
-+            return ctx->cr_entry[i]->ce_val;
-+    return NULL;
-+}
-+
-+API_EXPORT(ap_ctx *) ap_ctx_overlay(pool *p, ap_ctx *over, ap_ctx *base)
-+{
-+    ap_ctx *new;
-+    int i;
-+
-+#ifdef POOL_DEBUG
-+    if (p != NULL) {
-+        if (!ap_pool_is_ancestor(over->cr_pool, p))
-+            ap_log_assert("ap_ctx_overlay: overlay's pool is not an ancestor of p", 
-+                          __FILE__, __LINE__);
-+        if (!ap_pool_is_ancestor(base->cr_pool, p))
-+            ap_log_assert("ap_ctx_overlay: base's pool is not an ancestor of p",
-+                          __FILE__, __LINE__);
-+    }
-+#endif
-+    if ((new = ap_ctx_new(p)) == NULL)
-+        return NULL;
-+    memcpy(new->cr_entry, base->cr_entry, 
-+           sizeof(ap_ctx_entry *)*(AP_CTX_MAX_ENTRIES+1));
-+    for (i = 0; over->cr_entry[i] != NULL; i++)
-+        ap_ctx_set(new, over->cr_entry[i]->ce_key, over->cr_entry[i]->ce_val);
-+    return new;
-+}
-+
-+#endif /* EAPI */
-diff -Nru apache_1.3.20/src/ap/ap_hook.c apache_1.3.20.new/src/ap/ap_hook.c
---- apache_1.3.20/src/ap/ap_hook.c     Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/ap/ap_hook.c Thu Dec 30 22:02:56 1999
-@@ -0,0 +1,930 @@
-+#if 0
-+=pod
-+#endif
-+/* ====================================================================
-+ * 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 <http://www.apache.org/>.
-+ *
-+ */
-+
-+/*
-+**  Implementation of a Generic Hook Interface for Apache
-+**  Written by Ralf S. Engelschall <rse@engelschall.com> 
-+**
-+**  See POD document at end of ap_hook.h for description.
-+**  View it with the command ``pod2man ap_hook.h | nroff -man | more''
-+**
-+**  Attention: This source file is a little bit tricky.
-+**             It's a combination of a C source and an embedded Perl script
-+**             (which updates the C source). The purpose of this is to have
-+**             both things together at one place. So you can both pass
-+**             this file to the C compiler and the Perl interpreter.
-+*/
-+
-+                                      /*
-+                                       * Premature optimization is 
-+                                       * the root of all evil.
-+                                       *       -- D. E. Knuth
-+                                       */
-+
-+#ifdef EAPI
-+
-+#include "httpd.h"
-+#include "http_log.h"
-+#include "ap_config.h"
-+#include "ap_hook.h"
-+
-+/* 
-+ * the internal hook pool
-+ */
-+static ap_hook_entry **ap_hook_pool = NULL;
-+
-+/* 
-+ * forward prototypes for internal functions
-+ */
-+static int            ap_hook_call_func(va_list ap, ap_hook_entry *he, ap_hook_func *hf);
-+static ap_hook_entry *ap_hook_create(char *hook);
-+static ap_hook_entry *ap_hook_find(char *hook);
-+static void           ap_hook_destroy(ap_hook_entry *he);
-+
-+/*
-+ * Initialize the hook mechanism
-+ */
-+API_EXPORT(void) ap_hook_init(void)
-+{
-+    int i;
-+
-+    if (ap_hook_pool != NULL)
-+        return;
-+    ap_hook_pool = (ap_hook_entry **)malloc(sizeof(ap_hook_entry *)
-+                                            *(AP_HOOK_MAX_ENTRIES+1));
-+    for (i = 0; i < AP_HOOK_MAX_ENTRIES; i++)
-+        ap_hook_pool[i] = NULL;
-+    return;
-+}
-+
-+/*
-+ * Kill the hook mechanism
-+ */
-+API_EXPORT(void) ap_hook_kill(void)
-+{
-+    int i;
-+
-+    if (ap_hook_pool == NULL)
-+        return;
-+    for (i = 0; ap_hook_pool[i] != NULL; i++)
-+        ap_hook_destroy(ap_hook_pool[i]);
-+    free(ap_hook_pool);
-+    ap_hook_pool = NULL;
-+    return;
-+}
-+    
-+/*
-+ * Smart creation of a hook (when it exist this is the same as
-+ * ap_hook_find, when it doesn't exists it is created)
-+ */
-+static ap_hook_entry *ap_hook_create(char *hook)
-+{
-+    int i;
-+    ap_hook_entry *he;
-+
-+    for (i = 0; ap_hook_pool[i] != NULL; i++)
-+        if (strcmp(ap_hook_pool[i]->he_hook, hook) == 0)
-+            return ap_hook_pool[i];
-+
-+    if (i >= AP_HOOK_MAX_ENTRIES)
-+        return NULL;
-+
-+    if ((he = (ap_hook_entry *)malloc(sizeof(ap_hook_entry))) == NULL)
-+        return NULL;
-+    ap_hook_pool[i] = he;
-+
-+    he->he_hook          = strdup(hook);
-+    he->he_sig           = AP_HOOK_SIG_UNKNOWN;
-+    he->he_modeid        = AP_HOOK_MODE_UNKNOWN;
-+    he->he_modeval.v_int = 0;
-+
-+    he->he_func = (ap_hook_func **)malloc(sizeof(ap_hook_func *)
-+                                          *(AP_HOOK_MAX_FUNCS+1));
-+    if (he->he_func == NULL)
-+        return FALSE;
-+
-+    for (i = 0; i < AP_HOOK_MAX_FUNCS; i++)
-+        he->he_func[i] = NULL;
-+    return he;
-+}
-+
-+/*
-+ * Find a particular hook
-+ */
-+static ap_hook_entry *ap_hook_find(char *hook)
-+{
-+    int i;
-+
-+    for (i = 0; ap_hook_pool[i] != NULL; i++)
-+        if (strcmp(ap_hook_pool[i]->he_hook, hook) == 0)
-+            return ap_hook_pool[i];
-+    return NULL;
-+}
-+
-+/*
-+ * Destroy a particular hook
-+ */
-+static void ap_hook_destroy(ap_hook_entry *he)
-+{
-+    int i;
-+
-+    if (he == NULL)
-+        return;
-+    free(he->he_hook);
-+    for (i = 0; he->he_func[i] != NULL; i++)
-+        free(he->he_func[i]);
-+    free(he->he_func);
-+    free(he);
-+    return;
-+}
-+
-+/*
-+ * Configure a particular hook, 
-+ * i.e. remember its signature and return value mode
-+ */
-+API_EXPORT(int) ap_hook_configure(char *hook, ap_hook_sig sig, ap_hook_mode modeid, ...)
-+{
-+    ap_hook_entry *he;
-+    va_list ap;
-+    int rc;
-+
-+    va_start(ap, modeid);
-+    if ((he = ap_hook_create(hook)) == NULL)
-+        rc = FALSE;
-+    else {
-+        he->he_sig = sig;
-+        he->he_modeid = modeid;
-+        if (modeid == AP_HOOK_MODE_DECLINE || modeid == AP_HOOK_MODE_DECLTMP) {
-+            if (AP_HOOK_SIG_HAS(sig, RC, char))
-+                he->he_modeval.v_char = va_arg(ap, va_type(char));
-+            else if (AP_HOOK_SIG_HAS(sig, RC, int))
-+                he->he_modeval.v_int = va_arg(ap, va_type(int));
-+            else if (AP_HOOK_SIG_HAS(sig, RC, long))
-+                he->he_modeval.v_long = va_arg(ap, va_type(long));
-+            else if (AP_HOOK_SIG_HAS(sig, RC, float))
-+                he->he_modeval.v_float = va_arg(ap, va_type(float));
-+            else if (AP_HOOK_SIG_HAS(sig, RC, double))
-+                he->he_modeval.v_double = va_arg(ap, va_type(double));
-+            else if (AP_HOOK_SIG_HAS(sig, RC, ptr))
-+                he->he_modeval.v_ptr = va_arg(ap, va_type(ptr));
-+        }
-+        rc = TRUE;
-+    }
-+    va_end(ap);
-+    return rc;
-+}
-+
-+/*
-+ * Register a function to call for a hook
-+ */
-+API_EXPORT(int) ap_hook_register_I(char *hook, void *func, void *ctx)
-+{
-+    int i, j;
-+    ap_hook_entry *he;
-+    ap_hook_func *hf;
-+
-+    if ((he = ap_hook_create(hook)) == NULL)
-+        return FALSE;
-+
-+    for (i = 0; he->he_func[i] != NULL; i++)
-+        if (he->he_func[i]->hf_ptr == func)
-+            return FALSE;
-+
-+    if (i == AP_HOOK_MAX_FUNCS)
-+        return FALSE;
-+
-+    if ((hf = (ap_hook_func *)malloc(sizeof(ap_hook_func))) == NULL)
-+        return FALSE;
-+
-+    for (j = i; j >= 0; j--)
-+        he->he_func[j+1] = he->he_func[j];
-+    he->he_func[0] = hf;
-+
-+    hf->hf_ptr = func;
-+    hf->hf_ctx = ctx;
-+
-+    return TRUE;
-+}
-+
-+/*
-+ * Unregister a function to call for a hook
-+ */
-+API_EXPORT(int) ap_hook_unregister_I(char *hook, void *func)
-+{
-+    int i, j;
-+    ap_hook_entry *he;
-+
-+    if ((he = ap_hook_find(hook)) == NULL)
-+        return FALSE;
-+    for (i = 0; he->he_func[i] != NULL; i++) {
-+        if (he->he_func[i]->hf_ptr == func) {
-+            free(he->he_func[i]);
-+            for (j = i; he->he_func[j] != NULL; j++)
-+                he->he_func[j] = he->he_func[j+1];
-+            return TRUE;
-+        }
-+    }
-+    return FALSE;
-+}
-+
-+/*
-+ * Retrieve the status of a particular hook
-+ */
-+API_EXPORT(ap_hook_state) ap_hook_status(char *hook)
-+{
-+    ap_hook_entry *he;
-+
-+    if ((he = ap_hook_find(hook)) == NULL)
-+        return AP_HOOK_STATE_NOTEXISTANT;
-+    if (   he->he_func[0] != NULL 
-+        && he->he_sig != AP_HOOK_SIG_UNKNOWN
-+        && he->he_modeid != AP_HOOK_MODE_UNKNOWN)
-+        return AP_HOOK_STATE_REGISTERED;
-+    if (   he->he_sig != AP_HOOK_SIG_UNKNOWN 
-+        && he->he_modeid != AP_HOOK_MODE_UNKNOWN)
-+        return AP_HOOK_STATE_CONFIGURED;
-+    return AP_HOOK_STATE_ESTABLISHED;
-+}
-+
-+/*
-+ * Use a hook, i.e. optional on-the-fly configure it before calling it
-+ */
-+API_EXPORT(int) ap_hook_use(char *hook, ap_hook_sig sig, ap_hook_mode modeid, ...)
-+{
-+    int i;
-+    ap_hook_value modeval;
-+    ap_hook_entry *he;
-+    va_list ap;
-+    int rc;
-+
-+    va_start(ap, modeid);
-+
-+    if (modeid == AP_HOOK_MODE_DECLINE || modeid == AP_HOOK_MODE_DECLTMP) {
-+        if (AP_HOOK_SIG_HAS(sig, RC, char))
-+            modeval.v_char = va_arg(ap, va_type(char));
-+        else if (AP_HOOK_SIG_HAS(sig, RC, int))
-+            modeval.v_int = va_arg(ap, va_type(int));
-+        else if (AP_HOOK_SIG_HAS(sig, RC, long))
-+            modeval.v_long = va_arg(ap, va_type(long));
-+        else if (AP_HOOK_SIG_HAS(sig, RC, float))
-+            modeval.v_float = va_arg(ap, va_type(float));
-+        else if (AP_HOOK_SIG_HAS(sig, RC, double))
-+            modeval.v_double = va_arg(ap, va_type(double));
-+        else if (AP_HOOK_SIG_HAS(sig, RC, ptr))
-+            modeval.v_ptr = va_arg(ap, va_type(ptr));
-+    }
-+
-+    if ((he = ap_hook_create(hook)) == NULL)
-+        return FALSE;
-+
-+    if (he->he_sig == AP_HOOK_SIG_UNKNOWN)
-+        he->he_sig = sig;
-+    if (he->he_modeid == AP_HOOK_MODE_UNKNOWN) {
-+        he->he_modeid  = modeid;
-+        he->he_modeval = modeval;
-+    }
-+
-+    for (i = 0; he->he_func[i] != NULL; i++)
-+        if (ap_hook_call_func(ap, he, he->he_func[i]))
-+            break;
-+
-+    if (i > 0 && he->he_modeid == AP_HOOK_MODE_ALL)
-+        rc = TRUE;
-+    else if (i == AP_HOOK_MAX_FUNCS || he->he_func[i] == NULL)
-+        rc = FALSE;
-+    else
-+        rc = TRUE;
-+
-+    va_end(ap);
-+    return rc;
-+}
-+
-+/*
-+ * Call a hook
-+ */
-+API_EXPORT(int) ap_hook_call(char *hook, ...)
-+{
-+    int i;
-+    ap_hook_entry *he;
-+    va_list ap;
-+    int rc;
-+    
-+    va_start(ap, hook);
-+
-+    if ((he = ap_hook_find(hook)) == NULL) {
-+        va_end(ap);
-+        return FALSE;
-+    }
-+    if (   he->he_sig == AP_HOOK_SIG_UNKNOWN
-+        || he->he_modeid == AP_HOOK_MODE_UNKNOWN) {
-+        va_end(ap);
-+        return FALSE;
-+    }
-+
-+    for (i = 0; he->he_func[i] != NULL; i++)
-+        if (ap_hook_call_func(ap, he, he->he_func[i]))
-+            break;
-+
-+    if (i > 0 && he->he_modeid == AP_HOOK_MODE_ALL)
-+        rc = TRUE;
-+    else if (i == AP_HOOK_MAX_FUNCS || he->he_func[i] == NULL)
-+        rc = FALSE;
-+    else
-+        rc = TRUE;
-+
-+    va_end(ap);
-+    return rc;
-+}
-+
-+static int ap_hook_call_func(va_list ap, ap_hook_entry *he, ap_hook_func *hf)
-+{
-+    void *v_rc;
-+    ap_hook_value v_tmp;
-+    int rc;
-+
-+    /*
-+     * Now we dispatch the various function calls. We support function
-+     * signatures with up to 9 types (1 return type, 8 argument types) where
-+     * each argument can have 7 different types (ctx, char, int, long, float,
-+     * double, ptr), so theoretically there are 9^7 (=4782969) combinations
-+     * possible.  But because we don't need all of them, of course, we
-+     * implement only the following well chosen subset (duplicates are ok):
-+     *
-+     * 1. `The basic hook'.
-+     *
-+     *    void func()
-+     *
-+     * 2. The standard set of signatures which form all combinations of
-+     *    int&ptr based signatures for up to 3 arguments. We provide
-+     *    them per default for module authors.
-+     *
-+     *    int func()
-+     *    ptr func()
-+     *    int func(int)
-+     *    int func(ptr)
-+     *    ptr func(int)
-+     *    ptr func(ptr)
-+     *    int func(int,int)
-+     *    int func(int,ptr)
-+     *    int func(ptr,int)
-+     *    int func(ptr,ptr)
-+     *    ptr func(int,int)
-+     *    ptr func(int,ptr)
-+     *    ptr func(ptr,int)
-+     *    ptr func(ptr,ptr)
-+     *    int func(int,int,int)
-+     *    int func(int,int,ptr)
-+     *    int func(int,ptr,int)
-+     *    int func(int,ptr,ptr)
-+     *    int func(ptr,int,int)
-+     *    int func(ptr,int,ptr)
-+     *    int func(ptr,ptr,int)
-+     *    int func(ptr,ptr,ptr)
-+     *    ptr func(int,int,int)
-+     *    ptr func(int,int,ptr)
-+     *    ptr func(int,ptr,int)
-+     *    ptr func(int,ptr,ptr)
-+     *    ptr func(ptr,int,int)
-+     *    ptr func(ptr,int,ptr)
-+     *    ptr func(ptr,ptr,int)
-+     *    ptr func(ptr,ptr,ptr)
-+     *
-+     * 3. Actually currently used hooks.
-+     *
-+     *    int   func(ptr)                          [2x]
-+     *    int   func(ptr,ptr)                      [2x]
-+     *    int   func(ptr,ptr,int)                  [5x]
-+     *    int   func(ptr,ptr,ptr,int)              [1x]
-+     *    int   func(ptr,ptr,ptr,int,ptr)          [1x]
-+     *    int   func(ptr,ptr,ptr,ptr,int)          [1x]
-+     *    int   func(ptr,ptr,ptr,ptr,int,ptr)      [1x]
-+     *    ptr   func(ptr,ptr)                      [3x]
-+     *    ptr   func(ptr,ptr,ptr,ptr,ptr)          [1x]
-+     *    void  func(ptr)                          [2x]
-+     *    void  func(ptr,int,int)                  [1x]
-+     *    void  func(ptr,ptr)                      [5x]
-+     *    void  func(ptr,ptr,ptr)                  [3x]
-+     *    void  func(ptr,ptr,ptr,ptr)              [2x]
-+     *
-+     * To simplify the programming task we generate the actual dispatch code
-+     * for these calls via the embedded Perl script at the end of this source
-+     * file. This script parses the above lines and generates the section
-+     * below.  So, when you need more signature variants just add them to the
-+     * above list and run
-+     *
-+     *     $ perl ap_hook.c
-+     *
-+     * This automatically updates the above code.
-+     */
-+
-+    rc = TRUE;
-+    v_rc = NULL;
-+    if (!AP_HOOK_SIG_HAS(he->he_sig, RC, void)) {
-+        if (he->he_modeid == AP_HOOK_MODE_DECLTMP) {
-+            /* the return variable is a temporary one */ 
-+            if (AP_HOOK_SIG_HAS(he->he_sig, RC, char))
-+                v_rc = &v_tmp.v_char;
-+            else if (AP_HOOK_SIG_HAS(he->he_sig, RC, int))
-+                v_rc = &v_tmp.v_int;
-+            else if (AP_HOOK_SIG_HAS(he->he_sig, RC, long))
-+                v_rc = &v_tmp.v_long;
-+            else if (AP_HOOK_SIG_HAS(he->he_sig, RC, float))
-+                v_rc = &v_tmp.v_float;
-+            else if (AP_HOOK_SIG_HAS(he->he_sig, RC, double))
-+                v_rc = &v_tmp.v_double;
-+            else if (AP_HOOK_SIG_HAS(he->he_sig, RC, ptr))
-+                v_rc = &v_tmp.v_ptr;
-+        }
-+        else {
-+            /* the return variable is provided by caller */ 
-+            v_rc = va_arg(ap, void *);
-+        }
-+    }
-+
-+    /* ----BEGIN GENERATED SECTION-------- */
-+    if (he->he_sig == AP_HOOK_SIG1(void)) {
-+        /* Call: void func() */
-+        ((void(*)())(hf->hf_ptr))();
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG1(int)) {
-+        /* Call: int func() */
-+        *((int *)v_rc) = ((int(*)())(hf->hf_ptr))();
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG1(ptr)) {
-+        /* Call: ptr func() */
-+        *((void * *)v_rc) = ((void *(*)())(hf->hf_ptr))();
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG2(int, int)) {
-+        /* Call: int func(int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(int))(hf->hf_ptr))(v1);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG2(int, ptr)) {
-+        /* Call: int func(ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *))(hf->hf_ptr))(v1);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG2(ptr, int)) {
-+        /* Call: ptr func(int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(int))(hf->hf_ptr))(v1);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG2(ptr, ptr)) {
-+        /* Call: ptr func(ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(void *))(hf->hf_ptr))(v1);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(int, int, int)) {
-+        /* Call: int func(int,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(int, int))(hf->hf_ptr))(v1, v2);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(int, int, ptr)) {
-+        /* Call: int func(int,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(int, void *))(hf->hf_ptr))(v1, v2);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(int, ptr, int)) {
-+        /* Call: int func(ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(void *, int))(hf->hf_ptr))(v1, v2);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(int, ptr, ptr)) {
-+        /* Call: int func(ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *, void *))(hf->hf_ptr))(v1, v2);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(ptr, int, int)) {
-+        /* Call: ptr func(int,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(int, int))(hf->hf_ptr))(v1, v2);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(ptr, int, ptr)) {
-+        /* Call: ptr func(int,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(int, void *))(hf->hf_ptr))(v1, v2);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(ptr, ptr, int)) {
-+        /* Call: ptr func(ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(void *, int))(hf->hf_ptr))(v1, v2);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(ptr, ptr, ptr)) {
-+        /* Call: ptr func(ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(void *, void *))(hf->hf_ptr))(v1, v2);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, int, int, int)) {
-+        /* Call: int func(int,int,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(int, int, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, int, int, ptr)) {
-+        /* Call: int func(int,int,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(int, int, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, int, ptr, int)) {
-+        /* Call: int func(int,ptr,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(int, void *, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, int, ptr, ptr)) {
-+        /* Call: int func(int,ptr,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(int, void *, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, ptr, int, int)) {
-+        /* Call: int func(ptr,int,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(void *, int, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, ptr, int, ptr)) {
-+        /* Call: int func(ptr,int,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *, int, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, ptr, ptr, int)) {
-+        /* Call: int func(ptr,ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(void *, void *, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(int, ptr, ptr, ptr)) {
-+        /* Call: int func(ptr,ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *, void *, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, int, int, int)) {
-+        /* Call: ptr func(int,int,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(int, int, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, int, int, ptr)) {
-+        /* Call: ptr func(int,int,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        int   v2 = va_arg(ap, va_type(int));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(int, int, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, int, ptr, int)) {
-+        /* Call: ptr func(int,ptr,int) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(int, void *, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, int, ptr, ptr)) {
-+        /* Call: ptr func(int,ptr,ptr) */
-+        int   v1 = va_arg(ap, va_type(int));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(int, void *, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, ptr, int, int)) {
-+        /* Call: ptr func(ptr,int,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(void *, int, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, ptr, int, ptr)) {
-+        /* Call: ptr func(ptr,int,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(void *, int, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, ptr, ptr, int)) {
-+        /* Call: ptr func(ptr,ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        int   v3 = va_arg(ap, va_type(int));
-+        *((void * *)v_rc) = ((void *(*)(void *, void *, int))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(ptr, ptr, ptr, ptr)) {
-+        /* Call: ptr func(ptr,ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(void *, void *, void *))(hf->hf_ptr))(v1, v2, v3);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG5(int, ptr, ptr, ptr, int)) {
-+        /* Call: int func(ptr,ptr,ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        int   v4 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(void *, void *, void *, int))(hf->hf_ptr))(v1, v2, v3, v4);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG6(int, ptr, ptr, ptr, int, ptr)) {
-+        /* Call: int func(ptr,ptr,ptr,int,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        int   v4 = va_arg(ap, va_type(int));
-+        void *v5 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *, void *, void *, int, void *))(hf->hf_ptr))(v1, v2, v3, v4, v5);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG6(int, ptr, ptr, ptr, ptr, int)) {
-+        /* Call: int func(ptr,ptr,ptr,ptr,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        void *v4 = va_arg(ap, va_type(ptr));
-+        int   v5 = va_arg(ap, va_type(int));
-+        *((int *)v_rc) = ((int(*)(void *, void *, void *, void *, int))(hf->hf_ptr))(v1, v2, v3, v4, v5);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG7(int, ptr, ptr, ptr, ptr, int, ptr)) {
-+        /* Call: int func(ptr,ptr,ptr,ptr,int,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        void *v4 = va_arg(ap, va_type(ptr));
-+        int   v5 = va_arg(ap, va_type(int));
-+        void *v6 = va_arg(ap, va_type(ptr));
-+        *((int *)v_rc) = ((int(*)(void *, void *, void *, void *, int, void *))(hf->hf_ptr))(v1, v2, v3, v4, v5, v6);
-+        rc = (*((int *)v_rc) != he->he_modeval.v_int);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG6(ptr, ptr, ptr, ptr, ptr, ptr)) {
-+        /* Call: ptr func(ptr,ptr,ptr,ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        void *v4 = va_arg(ap, va_type(ptr));
-+        void *v5 = va_arg(ap, va_type(ptr));
-+        *((void * *)v_rc) = ((void *(*)(void *, void *, void *, void *, void *))(hf->hf_ptr))(v1, v2, v3, v4, v5);
-+        rc = (*((void * *)v_rc) != he->he_modeval.v_ptr);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG2(void, ptr)) {
-+        /* Call: void func(ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        ((void(*)(void *))(hf->hf_ptr))(v1);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(void, ptr, int, int)) {
-+        /* Call: void func(ptr,int,int) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        int   v2 = va_arg(ap, va_type(int));
-+        int   v3 = va_arg(ap, va_type(int));
-+        ((void(*)(void *, int, int))(hf->hf_ptr))(v1, v2, v3);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG3(void, ptr, ptr)) {
-+        /* Call: void func(ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        ((void(*)(void *, void *))(hf->hf_ptr))(v1, v2);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG4(void, ptr, ptr, ptr)) {
-+        /* Call: void func(ptr,ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        ((void(*)(void *, void *, void *))(hf->hf_ptr))(v1, v2, v3);
-+    }
-+    else if (he->he_sig == AP_HOOK_SIG5(void, ptr, ptr, ptr, ptr)) {
-+        /* Call: void func(ptr,ptr,ptr,ptr) */
-+        void *v1 = va_arg(ap, va_type(ptr));
-+        void *v2 = va_arg(ap, va_type(ptr));
-+        void *v3 = va_arg(ap, va_type(ptr));
-+        void *v4 = va_arg(ap, va_type(ptr));
-+        ((void(*)(void *, void *, void *, void *))(hf->hf_ptr))(v1, v2, v3, v4);
-+    }
-+    /* ----END GENERATED SECTION---------- */
-+    else
-+        ap_log_assert("hook signature not implemented", __FILE__, __LINE__);
-+
-+    if (he->he_modeid == AP_HOOK_MODE_ALL)
-+        rc = FALSE;
-+    else if (he->he_modeid == AP_HOOK_MODE_TOPMOST)
-+        rc = TRUE;
-+
-+    return rc;
-+}
-+
-+#endif /* EAPI */
-+
-+/*
-+=cut
-+##
-+##  Embedded Perl script for generating the dispatch section
-+##
-+
-+require 5.003;
-+use strict;
-+
-+#   configuration
-+my $file  = $0;
-+my $begin = '----BEGIN GENERATED SECTION--------';
-+my $end   = '----END GENERATED SECTION----------';
-+
-+#   special command: find used signatures
-+if ($ARGV[0] eq 'used') {
-+    my @S = `find .. -type f -name "*.c" -print`;
-+    my $s;
-+    my %T = ();
-+    foreach $s (@S) {
-+        $s =~ s|\n$||;
-+        open(FP, "<$s") || die;
-+        my $source = '';
-+        $source .= $_ while (<FP>);
-+        close(FP);
-+        my %seen = ();
-+        sub printme {
-+            my ($src, $hook, $sig) = @_;
-+            return if ($seen{$hook} == 1);
-+            $seen{$hook} = 1;
-+            my ($rc, $args) = ($sig =~ m|^([^,]+)(.*)$|);
-+            $args =~ s|^,||;
-+            $src =~ s|^.+/||;
-+            my $sig = sprintf("%-6sfunc(%s)", $rc, $args);
-+            $T{$sig}++; 
-+        }
-+        $source =~ s|\("([^"]+)",\s*AP_HOOK_SIG[0-9]\((.+?)\)|&printme($s, $1, $2), ''|sge;
-+    }
-+    my $t;
-+    foreach $t (sort(keys(%T))) {
-+        printf("     *    %-40s [%dx]\n", $t, $T{$t});
-+    }
-+    exit(0);
-+}
-+
-+#   read ourself and keep a backup
-+open(FP, "<$file") || die;
-+my $source = '';
-+$source .= $_ while (<FP>);
-+close(FP);
-+open(FP, ">$file.bak") || die;
-+print FP $source;
-+close(FP);
-+
-+#   now parse the signature lines and update the code
-+my $o = '';
-+my $next = 0;
-+my $line;
-+my %seen = ();
-+foreach $line (split(/\n/, $source)) {
-+    next if (not $line =~ m|\*\s+\S+\s+func\(.*\)|);
-+    my ($sig, $rc, $param) = ($line =~ m|\*\s+((\S+)\s+func\((.*?)\))|);
-+    $sig =~ s|\s+| |g;
-+
-+    next if ($seen{$sig} == 1);
-+    $seen{$sig} = 1;
-+
-+    print "Generating code for `$sig'\n";
-+
-+    my @S = ($rc, split(/[\s,]+/, $param));
-+    my @RS = @S;
-+    my $i;
-+    for ($i = 0; $i <= $#RS; $i++) {
-+        $RS[$i] = 'void *' if ($RS[$i] eq 'ptr');
-+        $RS[$i] = 'void *' if ($RS[$i] eq 'ctx');
-+    }
-+
-+    $o .= "else " if ($next); $next++;
-+    $o .= sprintf("if (he->he_sig == AP_HOOK_SIG%d(%s)) {\n", $#S+1, join(', ',@S));
-+    $o .= sprintf("    \/\* Call: %s \*\/\n", $sig);
-+    for ($i = 1; $i <= $#S; $i++) {
-+        $o .= sprintf("    %-6sv%d = va_arg(ap, va_type(%s));\n", $RS[$i], $i, $S[$i]);
-+    }
-+    $o .= "    ";
-+    $o .= sprintf("*((%s *)v_rc) = ", $RS[0]) if ($S[0] ne 'void');
-+    $o .= sprintf("((%s(*)(%s))(hf->hf_ptr))", $RS[0], join(', ', @RS[1..$#RS]));
-+    $o .= "(";
-+    for ($i = 1; $i <= $#S; $i++) {
-+        $o .= "hf->hf_ctx" if ($S[$i] eq 'ctx');
-+        $o .= sprintf("v%d", $i) if ($S[$i] ne 'ctx');
-+        $o .= ", " if ($i < $#S);
-+    }
-+    $o .= ");\n";
-+    $o .= sprintf("    rc = (*((%s *)v_rc) != he->he_modeval.v_%s);\n", 
-+                  $RS[0], $S[0]) if ($S[0] ne 'void');
-+    $o .= "}\n";
-+}
-+
-+#   insert the generated code at the target location
-+$o =~ s|^|    |mg;
-+$source =~ s|(\/\* $begin.+?\n).*\n(.*?\/\* $end)|$1$o$2|s;
-+
-+#   and update the source on disk
-+print "Updating file `$file'\n";
-+open(FP, ">$file") || die;
-+print FP $source;
-+close(FP);
-+
-+=pod
-+*/
-diff -Nru apache_1.3.20/src/ap/ap_mm.c apache_1.3.20.new/src/ap/ap_mm.c
---- apache_1.3.20/src/ap/ap_mm.c       Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/ap/ap_mm.c   Thu Dec 30 22:02:56 1999
-@@ -0,0 +1,178 @@
-+/* ====================================================================
-+ * Copyright (c) 1999-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 <http://www.apache.org/>.
-+ */
-+
-+/*
-+**  ap_mm.c -- wrapper for MM shared memory library
-+**
-+**  This file has two reason:
-+**
-+**  1. Under DSO context we need stubs inside the Apache core code
-+**     to make sure the MM library's code is actually available
-+**     to the module DSOs.
-+**
-+**  2. When the MM library cannot be built on the current platform
-+**     still provide dummy stubs so modules using the ap_mm_xxx()
-+**     functions can be still built. But modules should use
-+**     ap_mm_useable() to find out whether they really can use
-+**     the MM stuff.
-+*/
-+                                       /*
-+                                        * "What you see is all you get."
-+                                        *     -- Brian Kernighan
-+                                        */
-+#ifdef EAPI
-+
-+#include "httpd.h"
-+#include "ap_mm.h"
-+
-+#ifdef EAPI_MM
-+#include "mm.h"
-+API_EXPORT(int) ap_mm_useable(void) { return TRUE;  }
-+#define STUB(val,nul)               { return val;   }
-+#define STUB_STMT(stmt)             { stmt; return; }
-+#else
-+API_EXPORT(int) ap_mm_useable(void) { return FALSE; }
-+#define STUB(val,nul)               { return nul;   }
-+#define STUB_STMT(stmt)             { return;       }
-+#endif
-+
-+API_EXPORT(int) ap_MM_create(size_t size, char *file) 
-+    STUB(MM_create(size, file), FALSE)
-+API_EXPORT(int) ap_MM_permission(mode_t mode, uid_t owner, gid_t group) 
-+    STUB(MM_permission(mode, owner, group), -1)
-+API_EXPORT(void) ap_MM_destroy(void)
-+    STUB_STMT(MM_destroy())
-+API_EXPORT(int) ap_MM_lock(ap_mm_lock_mode mode)
-+    STUB(MM_lock(mode), FALSE)
-+API_EXPORT(int) ap_MM_unlock(void)
-+    STUB(MM_unlock(), FALSE)
-+API_EXPORT(void *) ap_MM_malloc(size_t size)
-+    STUB(MM_malloc(size), NULL)
-+API_EXPORT(void *) ap_MM_realloc(void *ptr, size_t size)
-+    STUB(MM_realloc(ptr, size), NULL)
-+API_EXPORT(void) ap_MM_free(void *ptr)
-+    STUB_STMT(MM_free(ptr))
-+API_EXPORT(void *) ap_MM_calloc(size_t number, size_t size)
-+    STUB(MM_calloc(number, size), NULL)
-+API_EXPORT(char *) ap_MM_strdup(const char *str)
-+    STUB(MM_strdup(str), NULL)
-+API_EXPORT(size_t) ap_MM_sizeof(void *ptr)
-+    STUB(MM_sizeof(ptr), 0)
-+API_EXPORT(size_t) ap_MM_maxsize(void)
-+    STUB(MM_maxsize(), 0)
-+API_EXPORT(size_t) ap_MM_available(void)
-+    STUB(MM_available(), 0)
-+API_EXPORT(char *) ap_MM_error(void)
-+    STUB(MM_error(), NULL)
-+
-+API_EXPORT(AP_MM *) ap_mm_create(size_t size, char *file)
-+    STUB(mm_create(size, file), NULL)
-+API_EXPORT(int) ap_mm_permission(AP_MM *mm, mode_t mode, uid_t owner, gid_t group) 
-+    STUB(mm_permission(mm, mode, owner, group), -1)
-+API_EXPORT(void) ap_mm_destroy(AP_MM *mm)
-+    STUB_STMT(mm_destroy(mm))
-+API_EXPORT(int) ap_mm_lock(AP_MM *mm, ap_mm_lock_mode mode)
-+    STUB(mm_lock(mm, mode), FALSE)
-+API_EXPORT(int) ap_mm_unlock(AP_MM *mm)
-+    STUB(mm_unlock(mm), FALSE)
-+API_EXPORT(void *) ap_mm_malloc(AP_MM *mm, size_t size)
-+    STUB(mm_malloc(mm, size), NULL)
-+API_EXPORT(void *) ap_mm_realloc(AP_MM *mm, void *ptr, size_t size)
-+    STUB(mm_realloc(mm, ptr, size), NULL)
-+API_EXPORT(void) ap_mm_free(AP_MM *mm, void *ptr)
-+    STUB_STMT(mm_free(mm, ptr))
-+API_EXPORT(void *) ap_mm_calloc(AP_MM *mm, size_t number, size_t size)
-+    STUB(mm_calloc(mm, number, size), NULL)
-+API_EXPORT(char *) ap_mm_strdup(AP_MM *mm, const char *str)
-+    STUB(mm_strdup(mm, str), NULL)
-+API_EXPORT(size_t) ap_mm_sizeof(AP_MM *mm, void *ptr)
-+    STUB(mm_sizeof(mm, ptr), 0)
-+API_EXPORT(size_t) ap_mm_maxsize(void)
-+    STUB(mm_maxsize(), 0)
-+API_EXPORT(size_t) ap_mm_available(AP_MM *mm)
-+    STUB(mm_available(mm), 0)
-+API_EXPORT(char *) ap_mm_error(void)
-+    STUB(mm_error(), NULL)
-+API_EXPORT(void) ap_mm_display_info(AP_MM *mm)
-+    STUB_STMT(mm_display_info(mm))
-+
-+API_EXPORT(void *) ap_mm_core_create(size_t size, char *file)
-+    STUB(mm_core_create(size, file), NULL)
-+API_EXPORT(int) ap_mm_core_permission(void *core, mode_t mode, uid_t owner, gid_t group) 
-+    STUB(mm_core_permission(core, mode, owner, group), -1)
-+API_EXPORT(void) ap_mm_core_delete(void *core)
-+    STUB_STMT(mm_core_delete(core))
-+API_EXPORT(size_t) ap_mm_core_size(void *core)
-+    STUB(mm_core_size(core), 0)
-+API_EXPORT(int) ap_mm_core_lock(void *core, ap_mm_lock_mode mode)
-+    STUB(mm_core_lock(core, mode), FALSE)
-+API_EXPORT(int) ap_mm_core_unlock(void *core)
-+    STUB(mm_core_unlock(core), FALSE)
-+API_EXPORT(size_t) ap_mm_core_maxsegsize(void)
-+    STUB(mm_core_maxsegsize(), 0)
-+API_EXPORT(size_t) ap_mm_core_align2page(size_t size)
-+    STUB(mm_core_align2page(size), 0)
-+API_EXPORT(size_t) ap_mm_core_align2word(size_t size)
-+    STUB(mm_core_align2word(size), 0)
-+
-+API_EXPORT(void) ap_mm_lib_error_set(unsigned int type, const char *str)
-+    STUB_STMT(mm_lib_error_set(type, str))
-+API_EXPORT(char *) ap_mm_lib_error_get(void)
-+    STUB(mm_lib_error_get(), NULL)
-+API_EXPORT(int) ap_mm_lib_version(void)
-+    STUB(mm_lib_version(), 0)
-+
-+#endif /* EAPI */
-diff -Nru apache_1.3.20/src/modules/extra/mod_define.c apache_1.3.20.new/src/modules/extra/mod_define.c
---- apache_1.3.20/src/modules/extra/mod_define.c       Thu Jan  1 01:00:00 1970
-+++ apache_1.3.20.new/src/modules/extra/mod_define.c   Thu Dec 30 22:00:58 1999
-@@ -0,0 +1,416 @@
-+/*
-+**  mod_define.c - Apache module for configuration defines ($xxx)
-+**
-+**  Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
-+**  Copyright (c) 1998-2000 Christian Reiber <chrei@en.muc.de>
-+**
-+**  Permission to use, copy, modify, and distribute this software for
-+**  any purpose with or without fee is hereby granted, provided that
-+**  the above copyright notice and this permission notice appear in all
-+**  copies.
-+**
-+**  THIS SOFTWARE IS PROVIDED ``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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-+**  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.
-+*/
-+
-+/*
-+ *  HISTORY
-+ *
-+ *  v1.0: Originally written in December 1998 by
-+ *        Ralf S. Engelschall <rse@engelschall.com> and
-+ *        Christian Reiber <chrei@en.muc.de>
-+ *
-+ *  v1.1: Completely Overhauled in August 1999 by
-+ *        Ralf S. Engelschall <rse@engelschall.com>
-+ */
-+
-+#include "ap_config.h"
-+#include "ap_ctype.h"
-+#include "httpd.h"
-+#include "http_config.h"
-+#include "http_conf_globals.h"
-+#include "http_core.h"
-+#include "http_log.h"
-+
-+#ifndef EAPI
-+#error "This module requires the Extended API (EAPI) facilities."
-+#endif
-+
-+/*
-+ * The global table of defines
-+ */
-+
-+static table *tDefines         = NULL;   /* global table of defines */
-+static int    bOnceSeenADefine = FALSE;  /* optimization flag */
-+
-+/*
-+ * Forward declaration
-+ */
-+static int   DefineIndex      (pool *, char *, int *, int *, char **);
-+static char *DefineFetch      (pool *, char *);
-+static char *DefineExpand     (pool *, char *, int, char *);
-+static void  DefineInit       (pool *);
-+static void  DefineCleanup    (void *);
-+static char *DefineRewriteHook(cmd_parms *, void *, const char *);
-+
-+/*
-+ * Character classes for scanner function
-+ */
-+typedef enum {
-+    CC_ESCAPE, CC_DOLLAR, CC_BRACEOPEN, CC_BRACECLOSE,
-+    CC_IDCHAR1, CC_IDCHAR, CC_OTHER, CC_EOS
-+} CharClass;
-+
-+/*
-+ * Scanner states for scanner function
-+ */
-+typedef enum {
-+    SS_NONE, SS_SKIP, SS_DOLLAR, SS_TOKEN_BRACED,
-+    SS_TOKEN_UNBRACED, SS_ERROR, SS_FOUND
-+} ScanState;
-+
-+/*
-+ * Default meta characters
-+ */
-+#define DEFAULT_MC_ESCAPE      "\\"
-+#define DEFAULT_MC_DOLLAR      "$"
-+#define DEFAULT_MC_BRACEOPEN   "{"
-+#define DEFAULT_MC_BRACECLOSE  "}"
-+
-+/*
-+ * Scanner for variable constructs $xxx and ${xxx}
-+ */
-+static int DefineIndex(pool *p, char *cpLine, int *pos, int *len, char **cpVar)
-+{
-+    int rc;
-+    char *cp;
-+    char *cp2;
-+    CharClass cc;
-+    char cEscape;
-+    char cDefine;
-+    char cBraceOpen;
-+    char cBraceClose;
-+    char *cpError;
-+    ScanState s;
-+
-+    cEscape = DEFAULT_MC_ESCAPE[0];
-+    if ((cp = DefineFetch(p, "mod_define::escape")) != NULL)
-+        cEscape = cp[0];
-+    cDefine = DEFAULT_MC_DOLLAR[0];
-+    if ((cp = DefineFetch(p, "mod_define::dollar")) != NULL)
-+        cDefine = cp[0];
-+    cBraceOpen = DEFAULT_MC_BRACEOPEN[0];
-+    if ((cp = DefineFetch(p, "mod_define::braceopen")) != NULL)
-+        cBraceOpen = cp[0];
-+    cBraceClose = DEFAULT_MC_BRACECLOSE[0];
-+    if ((cp = DefineFetch(p, "mod_define::braceclose")) != NULL)
-+        cBraceClose = cp[0];
-+
-+    rc = 0;
-+    *len = 0;
-+    cc = CC_OTHER;
-+    s = SS_NONE;
-+    for (cp = cpLine+(*pos); cc != CC_EOS; cp++) {
-+        if (*cp == cEscape)
-+            cc = CC_ESCAPE;
-+        else if (*cp == cDefine)
-+            cc = CC_DOLLAR;
-+        else if (*cp == cBraceOpen)
-+            cc = CC_BRACEOPEN;
-+        else if (*cp == cBraceClose)
-+            cc = CC_BRACECLOSE;
-+        else if (ap_isalpha(*cp))
-+            cc = CC_IDCHAR1;
-+        else if (ap_isdigit(*cp) || *cp == '_' || *cp == ':')
-+            cc = CC_IDCHAR;
-+        else if (*cp == '\0')
-+            cc = CC_EOS;
-+        else
-+            cc = CC_OTHER;
-+        switch (s) {
-+            case SS_NONE:
-+                switch (cc) {
-+                    case CC_ESCAPE:
-+                        s = SS_SKIP;
-+                        break;
-+                    case CC_DOLLAR:
-+                        s = SS_DOLLAR;
-+                        break;
-+                    default:
-+                        break;
-+                }
-+                break;
-+            case SS_SKIP:
-+                s = SS_NONE;
-+                continue;
-+                break;
-+            case SS_DOLLAR:
-+                switch (cc) {
-+                    case CC_BRACEOPEN:
-+                        s = SS_TOKEN_BRACED;
-+                        *pos = cp-cpLine-1;
-+                        (*len) = 2;
-+                        *cpVar = cp+1;
-+                        break;
-+                    case CC_IDCHAR1:
-+                        s = SS_TOKEN_UNBRACED;
-+                        *pos = cp-cpLine-1;
-+                        (*len) = 2;
-+                        *cpVar = cp;
-+                        break;
-+                    case CC_ESCAPE:
-+                        s = SS_SKIP;
-+                        break;
-+                    default:
-+                        s = SS_NONE;
-+                        break;
-+                }
-+                break;
-+            case SS_TOKEN_BRACED:
-+                switch (cc) {
-+                    case CC_IDCHAR1:
-+                    case CC_IDCHAR:
-+                        (*len)++;
-+                        break;
-+                    case CC_BRACECLOSE:
-+                        (*len)++;
-+                        cp2 = ap_palloc(p, cp-*cpVar+1);
-+                        ap_cpystrn(cp2, *cpVar, cp-*cpVar+1);
-+                        *cpVar = cp2;
-+                        s = SS_FOUND;
-+                        break;
-+                    default:
-+                        cpError = ap_psprintf(p, "Illegal character '%c' in identifier", *cp);
-+                        s = SS_ERROR;
-+                        break;
-+                }
-+                break;
-+            case SS_TOKEN_UNBRACED:
-+                switch (cc) {
-+                    case CC_IDCHAR1:
-+                    case CC_IDCHAR:
-+                        (*len)++;
-+                        break;
-+                    default:
-+                        cp2 = ap_palloc(p, cp-*cpVar+1);
-+                        ap_cpystrn(cp2, *cpVar, cp-*cpVar+1);
-+                        *cpVar = cp2;
-+                        s = SS_FOUND;
-+                        break;
-+                }
-+                break;
-+            case SS_FOUND:
-+            case SS_ERROR:
-+                break;
-+        }
-+        if (s == SS_ERROR) {
-+            fprintf(stderr, "Error\n");
-+            break;
-+        }
-+        else if (s == SS_FOUND) {
-+            rc = 1;
-+            break;
-+        }
-+    }
-+    return rc;
-+}
-+
-+/*
-+ * Determine the value of a variable
-+ */
-+static char *DefineFetch(pool *p, char *cpVar)
-+{
-+    char *cpVal;
-+
-+    /* first try out table */
-+    if ((cpVal = (char *)ap_table_get(tDefines, (char *)cpVar)) != NULL)
-+        return cpVal;
-+    /* second try the environment */
-+    if ((cpVal = getenv(cpVar)) != NULL)
-+        return cpVal;
-+    return NULL;
-+}
-+
-+/*
-+ * Expand a variable
-+ */
-+static char *DefineExpand(pool *p, char *cpToken, int tok_len, char *cpVal)
-+{
-+    char *cp;
-+    int val_len, rest_len;
-+
-+    val_len  = strlen(cpVal);
-+    rest_len = strlen(cpToken+tok_len);
-+    if (val_len < tok_len)
-+        memcpy(cpToken+val_len, cpToken+tok_len, rest_len+1);
-+    else if (val_len > tok_len)
-+        for (cp = cpToken+strlen(cpToken); cp > cpToken+tok_len-1; cp--)
-+            *(cp+(val_len-tok_len)) = *cp;
-+    memcpy(cpToken, cpVal, val_len);
-+    return NULL;
-+}
-+
-+/*
-+ * The EAPI hook which is called after Apache has read a
-+ * configuration line and before it's actually processed
-+ */
-+static char *DefineRewriteHook(cmd_parms *cmd, void *config, const char *line)
-+{
-+    pool *p;
-+    char *cpBuf;
-+    char *cpLine;
-+    int pos;
-+    int len;
-+    char *cpError;
-+    char *cpVar;
-+    char *cpVal;
-+    server_rec *s;
-+
-+    /* runtime optimization */
-+    if (!bOnceSeenADefine)
-+        return NULL;
-+
-+    p  = cmd->pool;
-+    s  = cmd->server;
-+
-+    /*
-+     * Search for:
-+     *  ....\$[a-zA-Z][:_a-zA-Z0-9]*....
-+     *  ....\${[a-zA-Z][:_a-zA-Z0-9]*}....
-+     */
-+    cpBuf = NULL;
-+    cpLine = (char *)line;
-+    pos = 0;
-+    while (DefineIndex(p, cpLine, &pos, &len, &cpVar)) {
-+#ifdef DEFINE_DEBUG
-+        {
-+        char prefix[1024];
-+        char marker[1024];
-+        int i;
-+        for (i = 0; i < pos; i++)
-+            prefix[i] = ' ';
-+        prefix[i] = '\0';
-+        for (i = 0; i < len; i++)
-+            marker[i] = '^';
-+        marker[i] = '\0';
-+        fprintf(stderr,
-+                "Found variable `%s' (pos: %d, len: %d)\n"
-+                "  %s\n"
-+                "  %s%s\n",
-+                cpVar, pos, len, cpLine, prefix, marker);
-+        }
-+#endif
-+        if (cpBuf == NULL) {
-+            cpBuf = ap_palloc(p, MAX_STRING_LEN);
-+            ap_cpystrn(cpBuf, line, MAX_STRING_LEN);
-+            cpLine = cpBuf;
-+        }
-+        if ((cpVal = DefineFetch(p, cpVar)) == NULL) {
-+            ap_log_error(APLOG_MARK, APLOG_ERR, s,
-+                         "mod_define: Variable '%s' not defined: file %s, line %d",
-+                         cpVar, cmd->config_file->name,
-+                         cmd->config_file->line_number);
-+            cpBuf = NULL;
-+            break;
-+        }
-+        if ((cpError = DefineExpand(p, cpLine+pos, len, cpVal)) != NULL) {
-+            ap_log_error(APLOG_MARK, APLOG_ERR, s,
-+                         "mod_define: %s: file %s, line %d",
-+                         cpError, cmd->config_file->name,
-+                         cmd->config_file->line_number);
-+            cpBuf = NULL;
-+            break;
-+        }
-+    }
-+    return cpBuf;
-+}
-+
-+/*
-+ * Implementation of the `Define' configuration directive
-+ */
-+static const char *cmd_define(cmd_parms *cmd, void *config,
-+                              char *cpVar, char *cpVal)
-+{
-+    if (tDefines == NULL)
-+        DefineInit(cmd->pool);
-+    ap_table_set(tDefines, cpVar, cpVal);
-+    bOnceSeenADefine = TRUE;
-+    return NULL;
-+}
-+
-+/*
-+ * Module Initialization
-+ */
-+
-+static void DefineInit(pool *p)
-+{
-+    tDefines = ap_make_table(p, 10);
-+    /* predefine delimiters */
-+    ap_table_set(tDefines, "mod_define::escape", DEFAULT_MC_ESCAPE);
-+    ap_table_set(tDefines, "mod_define::dollar", DEFAULT_MC_DOLLAR);
-+    ap_table_set(tDefines, "mod_define::open",   DEFAULT_MC_BRACEOPEN);
-+    ap_table_set(tDefines, "mod_define::close",  DEFAULT_MC_BRACECLOSE);
-+    ap_register_cleanup(p, NULL, DefineCleanup, ap_null_cleanup);
-+    return;
-+}
-+
-+/*
-+ * Module Cleanup
-+ */
-+
-+static void DefineCleanup(void *data)
-+{
-+    /* reset private variables when config pool is cleared */
-+    tDefines         = NULL;
-+    bOnceSeenADefine = FALSE;
-+    return;
-+}
-+
-+/*
-+ * Module Directive lists
-+ */
-+static const command_rec DefineDirectives[] = {
-+    { "Define", cmd_define, NULL, RSRC_CONF|ACCESS_CONF, TAKE2,
-+      "Define a configuration variable" },
-+    { NULL }
-+};
-+
-+/*
-+ * Module API dispatch list
-+ */
-+module MODULE_VAR_EXPORT define_module = {
-+    STANDARD_MODULE_STUFF,
-+    NULL,                  /* module initializer                  */
-+    NULL,                  /* create per-dir    config structures */
-+    NULL,                  /* merge  per-dir    config structures */
-+    NULL,                  /* create per-server config structures */
-+    NULL,                  /* merge  per-server config structures */
-+    DefineDirectives,      /* table of config file commands       */
-+    NULL,                  /* [#8] MIME-typed-dispatched handlers */
-+    NULL,                  /* [#1] URI to filename translation    */
-+    NULL,                  /* [#4] validate user id from request  */
-+    NULL,                  /* [#5] check if the user is ok _here_ */
-+    NULL,                  /* [#2] check access by host address   */
-+    NULL,                  /* [#6] determine MIME type            */
-+    NULL,                  /* [#7] pre-run fixups                 */
-+    NULL,                  /* [#9] log a transaction              */
-+    NULL,                  /* [#3] header parser                  */
-+    NULL,                  /* child_init                          */
-+    NULL,                  /* child_exit                          */
-+    NULL,                  /* [#0] post read-request              */
-+    NULL,                  /* EAPI: add_module                    */
-+    NULL,                  /* EAPI: del_module                    */
-+    DefineRewriteHook,     /* EAPI: rewrite_command               */
-+    NULL                   /* EAPI: new_connection                */
-+};
-+
diff --git a/apache-EAPI_MM=SYSTEM.patch b/apache-EAPI_MM=SYSTEM.patch
deleted file mode 100644 (file)
index fd85a88..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nru apache_1.3.12/src/Configuration.tmpl apache_1.3.12.new/src/Configuration.tmpl
---- apache_1.3.12/src/Configuration.tmpl       Tue Mar 14 02:04:30 2000
-+++ apache_1.3.12.new/src/Configuration.tmpl   Tue Mar 14 02:05:17 2000
-@@ -83,7 +83,7 @@
- #   course.
- Rule EAPI=no
--#EAPI_MM=SYSTEM
-+EAPI_MM=SYSTEM
- ################################################################
- # Dynamic Shared Object (DSO) support
diff --git a/apache-EAPI_MM_CORE_PATH-correction.patch b/apache-EAPI_MM_CORE_PATH-correction.patch
deleted file mode 100644 (file)
index 744b730..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nru apache_1.3.17/src/include/httpd.h apache_1.3.17.new/src/include/httpd.h
---- apache_1.3.17/src/include/httpd.h  Wed Jan 31 20:49:26 2001
-+++ apache_1.3.17.new/src/include/httpd.h      Wed Jan 31 20:51:53 2001
-@@ -377,7 +377,7 @@
-  */
- #ifdef EAPI
- #ifndef EAPI_MM_CORE_PATH
--#define EAPI_MM_CORE_PATH "logs/mm"
-+#define EAPI_MM_CORE_PATH "/var/run/apache/mm"
- #endif
- #ifndef EAPI_MM_CORE_MAXSIZE
- #define EAPI_MM_CORE_MAXSIZE 1024*1024*1 /* max. 1MB */
diff --git a/apache-PLD-nov6.patch b/apache-PLD-nov6.patch
deleted file mode 100644 (file)
index ec4b11f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urN apache_1.3.17/src/main/http_main.c apache_1.3.17-new/src/main/http_main.c
---- apache_1.3.17/src/main/http_main.c Sun Apr  1 00:56:33 2001
-+++ apache_1.3.17-new/src/main/http_main.c     Sun Apr  1 00:57:12 2001
-@@ -5004,7 +5004,7 @@
-     ap_setup_prelinked_modules();
-     while ((c = getopt(argc, argv,
--                                  "D:C:c:xXd:Ff:vVlLR:StTh"
-+                                  "D:C:c:xXd:Ff:vVlLR:StTh4"
- #ifdef DEBUG_SIGSTOP
-                                   "Z:"
- #endif
diff --git a/apache-PLD.patch b/apache-PLD.patch
deleted file mode 100644 (file)
index ed76835..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -urN apache_1.3.14.orig/config.layout apache_1.3.14/config.layout
---- apache_1.3.14.orig/config.layout   Tue Sep 26 01:44:55 2000
-+++ apache_1.3.14/config.layout        Sat Nov 11 20:41:04 2000
-@@ -249,3 +249,22 @@
-     proxycachedir: $localstatedir/cache/apache
- </Layout>
-+# PLD layout...
-+<Layout PLD>
-+    prefix:        /usr
-+    exec_prefix:   $prefix
-+    bindir:        $prefix/bin
-+    sbindir:       $prefix/sbin
-+    libexecdir:    $prefix/lib/apache
-+    mandir:        $prefix/share/man
-+    sysconfdir:    /etc/httpd
-+    datadir:       /home/httpd
-+    iconsdir:      $datadir/icons
-+    htdocsdir:     $datadir/html
-+    cgidir:        $datadir/cgi-bin
-+    includedir:    $prefix/include/apache
-+    localstatedir: /var
-+    runtimedir:    $localstatedir/run
-+    logfiledir:    $localstatedir/log/httpd
-+    proxycachedir: $localstatedir/cache/www/apache
-+</Layout>     
-diff -urN apache_1.3.14.orig/src/main/http_main.c apache_1.3.14/src/main/http_main.c
---- apache_1.3.14.orig/src/main/http_main.c    Thu Sep 28 15:32:36 2000
-+++ apache_1.3.14/src/main/http_main.c Sat Nov 11 20:39:48 2000
-@@ -432,6 +432,9 @@
-     else {
-       ap_add_version_component(SERVER_BASEVERSION " (" PLATFORM ")");
-     }
-+
-+    ap_add_version_component(" (PLD/Linux)");
-+    
-     /*
-      * Lock the server_version string if we're not displaying
-      * the full set of tokens
diff --git a/apache-apxs-quiet.patch b/apache-apxs-quiet.patch
deleted file mode 100644 (file)
index 301529f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- apache_1.3.22/src/support/apxs.pl.orig     Fri Dec  7 20:32:18 2001
-+++ apache_1.3.22/src/support/apxs.pl  Fri Dec  7 21:47:25 2001
-@@ -111,6 +111,7 @@
- my $opt_a = 0;
- my $opt_A = 0;
- my $opt_q = 0;
-+my $opt_v = 0;
- #   this subroutine is derived from Perl's getopts.pl with the enhancement of
- #   the "+" metacharater at the format string to allow a list to be build by
-@@ -190,7 +191,7 @@
- #   option handling
- my $rc;
--($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+eiaA", @ARGV);
-+($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+eiaAv", @ARGV);
- &usage if ($rc == 0);
- &usage if ($#ARGV == -1 and not $opt_g);
- &usage if (not $opt_q and not ($opt_g and $opt_n) and not $opt_i and not $opt_c and not $opt_e);
-@@ -247,7 +248,9 @@
-     my ($cmd, $rc);
-     foreach $cmd (@cmds) {
--        print STDERR "$cmd\n";
-+      if ($opt_v or not $opt_e) {
-+          print STDERR "$cmd\n";
-+      }
-         $rc = system("$cmd");
-         if ($rc != 0) {
-             printf(STDERR "apxs:Break: Command failed with rc=%d\n", $rc >> 8);
diff --git a/apache-apxs_force_rm_cp.patch b/apache-apxs_force_rm_cp.patch
deleted file mode 100644 (file)
index 6b9e9b0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Nru apache_1.3.12/src/support/apxs.pl apache_1.3.12.new/src/support/apxs.pl
---- apache_1.3.12/src/support/apxs.pl  Mon Jun 12 18:37:55 2000
-+++ apache_1.3.12.new/src/support/apxs.pl      Mon Jun 12 18:39:53 2000
-@@ -459,7 +459,7 @@
-         if ($^O ne "MSWin32") {
-             $t =~ s|^.+/([^/]+)$|$1|;
-             if ($opt_i) {
--                push(@cmds, "cp $f $CFG_LIBEXECDIR/$t");
-+                push(@cmds, "cp -f $f $CFG_LIBEXECDIR/$t");
-                 push(@cmds, "chmod 755 $CFG_LIBEXECDIR/$t");
-             }
-         }
-@@ -555,9 +555,9 @@
-                 print FP $content;
-                 close(FP);
-                 if ($^O ne "MSWin32") {
--                    push(@cmds, "cp $cfgbase.conf $cfgbase.conf.bak");
--                    push(@cmds, "cp $cfgbase.conf.new $cfgbase.conf");
--                    push(@cmds, "rm $cfgbase.conf.new");
-+                    push(@cmds, "cp -f $cfgbase.conf $cfgbase.conf.bak");
-+                    push(@cmds, "cp -f $cfgbase.conf.new $cfgbase.conf");
-+                    push(@cmds, "rm -f $cfgbase.conf.new");
-                 } else {
-                     $cfgbase =~ s|/|\\|g;
-                     push(@cmds, "copy \"$cfgbase.conf\" \"$cfgbase.conf.bak\"");
diff --git a/apache-buff.patch b/apache-buff.patch
deleted file mode 100644 (file)
index 9196627..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
---- apache_1.3.12/src/main/buff.c~     Sun Feb 27 07:16:27 2000
-+++ apache_1.3.12/src/main/buff.c      Sun Feb 27 07:39:15 2000
-@@ -1133,6 +1133,102 @@
- }
- #endif
-+/* The SGI Performance patch replaces writev_it_all by ap_bwritev
-+ * We don't want this, as it breaks mod_ssl ... the code is commented
-+ * out for now.
-+ * 
-+ * static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
-+ * {
-+ *   return (ap_bwritev(fb, vec, nvec) >= 0) ? 0 : -1;
-+ * }
-+ *
-+ */
-+  
-+/*
-+ * Write data using writev() if available, write() otherwise.
-+ * Returns number of bytes written or -1 on error.
-+ * Note that it may modify iov;
-+ */
-+API_EXPORT(int)
-+ap_bwritev(BUFF *fb, struct iovec *iov, int iovcnt)
-+{
-+    int rval;
-+
-+    if ((fb->flags & (B_EOUT | B_WRERR | B_WR)) == B_WR) {
-+#ifndef NO_WRITEV
-+      int i, len;
-+
-+      rval = 0;
-+
-+      len = 0;
-+      for (i = 0; i < iovcnt; i++)
-+          len += iov[i].iov_len;
-+
-+      while (len > 0) {
-+          int w;
-+
-+          w = (iovcnt > 1) ? (int) writev(fb->fd, iov, iovcnt) :
-+              (int) write(fb->fd, iov->iov_base, iov->iov_len);
-+          if (w >= 0) {
-+              rval += w;
-+              fb->bytes_sent += w;
-+
-+              len -= w;
-+              if (len == 0)
-+                  break;      /* shortcut the common case */
-+
-+              while (w > iov[0].iov_len) {
-+                  w -= iov[0].iov_len;
-+                  iov++;
-+                  iovcnt--;
-+              }
-+              iov[0].iov_base = (char *) iov[0].iov_base + w;
-+              iov[0].iov_len -= w;
-+          } else if (errno != EINTR && errno != EAGAIN) {
-+              doerror(fb, B_WR);
-+              rval = -1;
-+              break;
-+          }
-+
-+          if (fb->flags & B_EOUT) {   /* set asynchronously */
-+              rval = -1;
-+              break;
-+          }
-+      }
-+#else
-+      int i;
-+
-+      rval = 0;
-+      for (i = 0; i < iovcnt; i++) {
-+          while (iov[i].iov_len > 0) {
-+              int w;
-+
-+              w = write(fb->fd, iov[i].iov_base, iov[i].iov_len);
-+              if (w >= 0) {
-+                  rval += w;
-+                  fb->bytes_sent += w;
-+                  iov[i].iov_base = (char *) iov[i].iov_base + w;
-+                  iov[i].iov_len -= w;
-+              } else if (errno != EINTR && errno != EAGAIN) {
-+                  doerror(fb, B_WR);
-+                  rval = -1;
-+                  break;
-+              }
-+
-+              if (fb->flags & B_EOUT) {       /* set asynchronously */
-+                  rval = -1;
-+                  break;
-+              }
-+          }
-+      }
-+#endif
-+    } else
-+      rval = -1;
-+
-+    return rval;
-+}
-+
-+
- /* A wrapper for buff_write which deals with error conditions and
-  * bytes_sent.  Also handles non-blocking writes.
-  */
diff --git a/apache-db3.patch b/apache-db3.patch
deleted file mode 100644 (file)
index 40440e8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -Nur apache_1.3.17.orig/src/modules/standard/mod_auth_dbm.c apache_1.3.17/src/modules/standard/mod_auth_dbm.c
---- apache_1.3.17.orig/src/modules/standard/mod_auth_dbm.c     Wed Feb  7 23:10:02 2001
-+++ apache_1.3.17/src/modules/standard/mod_auth_dbm.c  Wed Feb  7 23:14:06 2001
-@@ -81,7 +81,8 @@
- #define dbm_fetch sdbm_fetch
- #define dbm_close sdbm_close
- #else
--#include <ndbm.h>
-+#define DB_DBM_HSEARCH 1
-+#include <db.h>
- #endif
- /*
-diff -Nur apache_1.3.17.orig/src/modules/standard/mod_rewrite.h apache_1.3.17/src/modules/standard/mod_rewrite.h
---- apache_1.3.17.orig/src/modules/standard/mod_rewrite.h      Thu Jan 18 23:31:44 2001
-+++ apache_1.3.17/src/modules/standard/mod_rewrite.h   Wed Feb  7 23:15:22 2001
-@@ -130,7 +130,8 @@
-      * so we also need to know the file extension
-      */
- #ifndef NO_DBM_REWRITEMAP
--#include <ndbm.h>
-+#define DB_DBM_HSEARCH 1
-+#include <db.h>
- #if defined(DBM_SUFFIX)
- #define NDBM_FILE_SUFFIX DBM_SUFFIX
- #elif defined(__FreeBSD__) || (defined(DB_LOCK) && defined(DB_SHMEM))
---- apache_1.3.23/src/helpers/find-dbm-lib.orig        Tue Jan 22 08:39:15 2002
-+++ apache_1.3.23/src/helpers/find-dbm-lib     Wed Feb  6 21:34:50 2002
-@@ -13,7 +13,9 @@
-           *-linux*)
-               # many systems don't have -ldbm
-               DBM_LIB=""
--              if ./helpers/TestCompile lib ndbm dbm_open; then
-+              if ./helpers/TestCompile lib db __db_ndbm_open; then
-+                  DBM_LIB="-ldb"
-+              elif ./helpers/TestCompile lib ndbm dbm_open; then
-                   DBM_LIB="-lndbm"
-                   if ./helpers/TestCompile lib db1 dbm_open; then
-                       # Red Hat needs this; ndbm.h lives in db1
diff --git a/apache-errordocs.patch b/apache-errordocs.patch
deleted file mode 100644 (file)
index c9ed6cf..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-diff -Nru apache_1.3.9/errordocs/400.shtml apache_1.3.9.new/errordocs/400.shtml
---- apache_1.3.9/errordocs/400.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/400.shtml       Wed Jul 15 13:54:20 1998
-@@ -0,0 +1,24 @@
-+<!--#set var="title" value="Bad Request : Niepoprawne zapytanie"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Bad Request : Niepoprawne zapytanie
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+Your browser sent a request that this server could not understand.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Twoja przegl±darka przes³a³a zapytanie, które nie mo¿e zinterpretowaæ serwer.
-+B³±d w sk³adni zapytania.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/401.shtml apache_1.3.9.new/errordocs/401.shtml
---- apache_1.3.9/errordocs/401.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/401.shtml       Wed Jul 15 13:54:30 1998
-@@ -0,0 +1,28 @@
-+<!--#set var="title" value="Authorization Required : Brak autoryzacji"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Authorization Required : Brak autoryzacji
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+This server could not verify that you are authorized to access the document
-+you requested. Either you supplied the wrong credentials (e.g. bad password)
-+or your browser doesn't understand how to supply the credentials required.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Zapytanie nie przesz³o pomy¶lnie procesu uwierzytelnienia.
-+Serwer nie mo¿e zweryfikowaæ czy posiadasz autoryzacjê dostêpu do dokumentu,
-+który Â¿Â±dasz. Prawdopodobnie wprowadzono nieprawid³owe dane jak np. has³o lub 
-+twoja przegl±darka nie potrafi dostarczyæ w³a¶ciwych danych do autoryzacji.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"-->
-diff -Nru apache_1.3.9/errordocs/403.shtml apache_1.3.9.new/errordocs/403.shtml
---- apache_1.3.9/errordocs/403.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/403.shtml       Wed Jul 15 13:54:52 1998
-@@ -0,0 +1,31 @@
-+<!--#set var="title" value="Forbidden : Dostêp zabroniony"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Forbidden : Dostêp zabroniony
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+You don't have permission to access 
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->
-+</STRONG>
-+on this server.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Zapytanie odrzucone przez serwer. Nie masz dostêpu do 
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->
-+</STRONG>
-+na tym serwerze.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"-->
-diff -Nru apache_1.3.9/errordocs/404.shtml apache_1.3.9.new/errordocs/404.shtml
---- apache_1.3.9/errordocs/404.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/404.shtml       Wed Jul 15 13:54:58 1998
-@@ -0,0 +1,31 @@
-+<!--#set var="title" value="File Not Found : Plik nie istnieje"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] File Not Found : Plik nie istnieje
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The requested URL  
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->
-+</STRONG>
-+was not found on this server.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Podany w zapytaniu URL  
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->
-+</STRONG>
-+nie zosta³ odnaleziony na tym serwerze.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"-->
-diff -Nru apache_1.3.9/errordocs/405.shtml apache_1.3.9.new/errordocs/405.shtml
---- apache_1.3.9/errordocs/405.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/405.shtml       Wed Jul 15 13:55:04 1998
-@@ -0,0 +1,37 @@
-+<!--#set var="title" value="Method Not Allowed : Niedozwolona metoda"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Method Not Allowed : Niedozwolona metoda
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The requested method
-+<STRONG>  
-+<!--#echo var="REQUEST_METHOD"--> 
-+</STRONG>
-+is not allowed for the URL  
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->.
-+</STRONG>
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+Metoda 
-+<STRONG>
-+<!--#echo var="REQUEST_METHOD"--> 
-+</STRONG>
-+nie jest obs³ugiwana przez wybrany URL 
-+<STRONG>
-+<!--#echo var="REQUEST_URI"-->.
-+</STRONG>
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/406.shtml apache_1.3.9.new/errordocs/406.shtml
---- apache_1.3.9/errordocs/406.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/406.shtml       Wed Jul 15 13:55:10 1998
-@@ -0,0 +1,31 @@
-+<!--#set var="title" value="Not Acceptable : Brak akceptacji"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Not Acceptable : Brak akceptacji
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+An appropriate representation of the requested resource 
-+<STRONG> 
-+<!--#echo var="REQUEST_URI"--> 
-+</STRONG>
-+could not be found on this server.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>  
-+Format podanego URL
-+<STRONG>
-+<!--#echo var="REQUEST_URI"--> 
-+</STRONG>
-+nie jest akceptowany przez serwer.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/408.shtml apache_1.3.9.new/errordocs/408.shtml
---- apache_1.3.9/errordocs/408.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/408.shtml       Wed Jul 15 13:55:18 1998
-@@ -0,0 +1,23 @@
-+<!--#set var="title" value="Request Time-out : Przekroczony czas oczekiwania"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Request Time-out : Przekroczony czas oczekiwania
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+I'm tired of waiting for your request.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD> 
-+Przekroczony czas na przygotowanie zapytania.
-+</TD></TR>
-+</TABLE>
-+</CENTER> 
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/410.shtml apache_1.3.9.new/errordocs/410.shtml
---- apache_1.3.9/errordocs/410.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/410.shtml       Wed Jul 15 13:55:22 1998
-@@ -0,0 +1,33 @@
-+<!--#set var="title" value="Gone : URI usuniête"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Gone : URI usuniête
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The requested resource 
-+<STRONG>
-+<!--#echo var="REQUEST_URI"--> 
-+</STRONG>
-+is no longer available on this server and there is no forwarding address. 
-+Please remove all references to this resource.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Podany w zapytaniu URL
-+<STRONG>
-+<!--#echo var="REQUEST_URI"--> 
-+</STRONG>
-+jest ju¿ nie dostêpny na tym serwerze. Proszê usun±æ wszystkie 
-+odwo³ania do tego URL.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/411.shtml apache_1.3.9.new/errordocs/411.shtml
---- apache_1.3.9/errordocs/411.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/411.shtml       Wed Jul 15 13:55:26 1998
-@@ -0,0 +1,31 @@
-+<!--#set var="title" value="Length Required : Wymagana d³ugo¶æ"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Length Required : Wymagana d³ugo¶æ
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+A request of the requested method  
-+<STRONG> 
-+<!--#echo var="REQUEST_METHOD"--> 
-+</STRONG>
-+requires a valid Content-length.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>  
-+Wybrana metoda 
-+<STRONG>
-+<!--#echo var="REQUEST_METHOD"--> 
-+</STRONG>
-+wymaga poprawnego nag³ówka Content-length.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/414.shtml apache_1.3.9.new/errordocs/414.shtml
---- apache_1.3.9/errordocs/414.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/414.shtml       Wed Jul 15 13:55:34 1998
-@@ -0,0 +1,23 @@
-+<!--#set var="title" value="Request-URI Too Large : Zbyt d³ugi URI"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Request-URI Too Large : Zbyt d³ugi URI
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The requested URL's length exeeds the capacity limit for this server.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+D³ugo¶æ wybranego URL przekracza zekres zdefiniowany na tym serwerze.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/500.shtml apache_1.3.9.new/errordocs/500.shtml
---- apache_1.3.9/errordocs/500.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/500.shtml       Wed Jul 15 13:55:38 1998
-@@ -0,0 +1,37 @@
-+<!--#set var="title" value="Internal Server Error : Wewnêtrzny b³±d serwera"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Internal Server Error : Wewnêtrzny b³±d serwera
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The server encountered an internal error or misconfiguration and was unable 
-+to complete your request. Please contact the server administrator 
-+<A HREF="mailto:<!--#echo var="SERVER_ADMIN"-->?subject=B³±d: [<!--#echo var="REDIRECT_STATUS"-->] 
-+              <!--#echo var="title"-->, URL=<!--#echo var="REQUEST_URI"-->">
-+<!--#echo var="SERVER_ADMIN"-->
-+</A> 
-+and inform them of the time the error occured and anything you might have 
-+done that may have caused the error.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD> 
-+Wewnêtrzny b³±d serwera (np. zawieszenie programu CGI) lub b³±d konfiguracji.
-+Proszê skontaktowaæ siê z administratorem 
-+<A HREF="mailto:<!--#echo var="SERVER_ADMIN"-->?subject=B³±d: [<!--#echo var="REDIRECT_STATUS"-->] 
-+              <!--#echo var="title"-->, URL=<!--#echo var="REQUEST_URI"-->">
-+<!--#echo var="SERVER_ADMIN"-->
-+</A>  
-+i poinformowaæ go o czasie pojawienia siê b³êdu wraz z podaniem innych informacji, 
-+które mog³y byæ przyczyn± b³êdu.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/503.shtml apache_1.3.9.new/errordocs/503.shtml
---- apache_1.3.9/errordocs/503.shtml   Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/503.shtml       Wed Jul 15 13:55:48 1998
-@@ -0,0 +1,25 @@
-+<!--#set var="title" value="Service Temporarily Unavailable : Us³ugi tymczasowo niedostêpne"-->
-+<!--#include virtual="HEADER.shtml"-->
-+<H2 ALIGN="center">
-+[<!--#echo var="REDIRECT_STATUS"-->] Service Temporarily Unavailable : Us³ugi tymczasowo niedostêpne
-+</H2>
-+<HR>
-+<CENTER>
-+<TABLE>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="english"-->" WIDTH=26 HIGHT=19 ALT="English">
-+</TD><TD>
-+The server is temporarily unable to service your request due to 
-+maintenance downtime or capacity problems. Please try again later.
-+</TD></TR><TR><TD></TD><TD><HR></TD></TR>
-+<TR><TD VALIGN="top" ALIGN="left" WIDTH=50>
-+<IMG SRC="<!--#echo var="polish"-->" WIDTH=26 HIGHT=19 ALT="Polish">
-+</TD><TD>
-+Us³ugi serwera s± czasowo niedostêpne co mo¿e byæ spowodowane jego zatrzymaniem 
-+lub prze³adowaniem. Proszê spróbowaæ po³±czyæ siê pó¼niej.
-+</TD></TR>
-+</TABLE>
-+</CENTER>
-+<P>
-+<HR>
-+<!--#include virtual="FOOT.shtml"--> 
-diff -Nru apache_1.3.9/errordocs/FOOT.shtml apache_1.3.9.new/errordocs/FOOT.shtml
---- apache_1.3.9/errordocs/FOOT.shtml  Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/FOOT.shtml      Sun Jan  3 17:11:22 1999
-@@ -0,0 +1,30 @@
-+<P>
-+<!--#set var="Mail" value="/icons/email.gif"-->
-+<!--#set var="Powered_by_Apache" value="/icons/apache_pb.gif"-->
-+<!--#set var="Powered_by_Linux" value="/icons/linux_pwd.gif"-->
-+<CENTER>
-+<IMG SRC="<!--#echo var="Mail"-->" WIDTH=50 HIGHT=66 ALT="Mail to:">
-+<BR>
-+<A HREF="mailto:<!--#echo var="SERVER_ADMIN"-->?subject=Blad: [<!--#echo var="REDIRECT_STATUS"-->] 
-+              <!--#echo var="title"-->, URL=<!--#echo var="REQUEST_URI"-->">
-+<!--#echo var="SERVER_ADMIN"-->
-+</A>
-+<P> 
-+<TABLE WIDTH=50%>
-+<TR>
-+<TD ALIGN="left">
-+<IMG SRC="<!--#echo var="Powered_by_Apache"-->" WIDTH=259 HIGHT=32 ALT="Powered by Apache">
-+</TD>
-+<TD ALIGN="right">
-+<IMG SRC="<!--#echo var="Powered_by_Linux"-->" WIDTH=196 HIGHT=49 ALT="Powered by Linux">
-+</TD>
-+</TR>
-+</TABLE>
-+<BR>
-+<FONT SIZE=-3>
-+data:<!--#echo var="DATE_LOCAL"-->,
-+ostatnia modyfikacja: <!--#echo var="LAST_MODIFIED"-->
-+</FONT>
-+</CENTER>
-+</BODY>
-+</HTML>
-diff -Nru apache_1.3.9/errordocs/HEADER.shtml apache_1.3.9.new/errordocs/HEADER.shtml
---- apache_1.3.9/errordocs/HEADER.shtml        Thu Jan  1 01:00:00 1970
-+++ apache_1.3.9.new/errordocs/HEADER.shtml    Wed Jul 15 13:56:44 1998
-@@ -0,0 +1,14 @@
-+<HTML>
-+<HEAD>
-+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-2">
-+<TITLE>
-+<!--#echo var="title"-->
-+</TITLE>
-+</HEAD>
-+<BODY BGCOLOR="#FFFFFF">
-+<!--#set var="english" value="/icons/gb.gif"-->
-+<!--#set var="polish" value="/icons/poland.gif"-->
-+<H2 ALIGN="center">
-+[Error : B³±d]
-+</H2>
-+<P>
diff --git a/apache-fpic.patch b/apache-fpic.patch
deleted file mode 100644 (file)
index 01c8f37..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -urN apache_1.3.17.org/src/Configure apache_1.3.17/src/Configure
---- apache_1.3.17.org/src/Configure    Wed Jan 31 18:58:27 2001
-+++ apache_1.3.17/src/Configure        Wed Jan 31 18:58:58 2001
-@@ -1055,14 +1055,14 @@
-           LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
-           ;;
-       *-linux1)
--          CFLAGS_SHLIB="-fpic"
-+          CFLAGS_SHLIB="-fPIC"
-           LDFLAGS_SHLIB="-Bshareable"
-           LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
-           LDFLAGS_SHLIB_EXPORT="-rdynamic"
-           ;;
-       *-linux2*)
-               LD_SHLIB="gcc"
--          CFLAGS_SHLIB="-fpic"
-+          CFLAGS_SHLIB="-fPIC"
-           LDFLAGS_SHLIB="-shared"
-           LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB
-           LDFLAGS_SHLIB_EXPORT="-rdynamic"
diff --git a/apache-htdocs.patch b/apache-htdocs.patch
deleted file mode 100644 (file)
index 49c4285..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-diff -Nur apache_1.3.6/htdocs/manual/search/manual-index.cgi apache_1.3.6.pld/htdocs/manual/search/manual-index.cgi
---- apache_1.3.6/htdocs/manual/search/manual-index.cgi Fri Feb 26 01:39:58 1999
-+++ apache_1.3.6.pld/htdocs/manual/search/manual-index.cgi     Wed May 26 18:00:39 1999
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl5 -w
-+#!/usr/bin/perl -w
- # ====================================================================
- # Copyright (c) 1995-1997 The Apache Group.  All rights reserved.
- #
diff --git a/apache-ipv6-PLD.patch b/apache-ipv6-PLD.patch
deleted file mode 100644 (file)
index c50ed87..0000000
+++ /dev/null
@@ -1,4666 +0,0 @@
-diff -Nur apache_1.3.26.orig/README.v6 apache_1.3.26/README.v6
---- apache_1.3.26.orig/README.v6       Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/README.v6    Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,166 @@
-+IPv6-ready apache 1.3.x
-+KAME Project
-+$Id$
-+
-+This patchkit enables apache 1.3.x to perform HTTP connection over IPv6.
-+Most of optional modules are left unchanged, i.e. it won't support IPv6,
-+and it may not compile.
-+
-+Basically you can write IPv6 address where IPv4 address fits.
-+
-+extra command-line argument:
-+      -4      Assume IPv4 address on ambiguous directives
-+      -6      Assume IPv6 address on ambiguous directives (default)
-+
-+      The above two can be used, for example, to disambiguate
-+      "BindAddress *".
-+
-+base commands:
-+    Listen
-+      Listen is expanded to take one or two arguments.
-+              Listen port
-+              Listen address:port
-+              Listen address port
-+      This is to let you specify "Listen :: 80", since "Listen :::80"
-+      won't work.
-+
-+mod_access:
-+    deny from
-+    allow from
-+      "deny from" and "allow from" supports IPv6 addresses, under the
-+      following forms:
-+              {deny,allow} from v6addr
-+              {deny,allow} from v6addr/v6mask
-+              {deny,allow} from v6addr/prefixlen
-+      Also, wildcard ("*") and string hostname matches IPv6 hosts as well.
-+
-+mod_proxy:
-+    ProxyRequests on
-+      http/ftp proxying for both IPv4 and IPv6 is possible.
-+      Access control functions (NoProxy) are not updated yet.
-+
-+      NOTE: for security reasons, we recommend you to filter out
-+      outsider's access to your proxy, by directives like below:
-+              <Directory proxy:*>
-+              order deny,allow
-+              deny from all
-+              allow from 10.0.0.0/8
-+              allow from 3ffe:9999:8888:7777::/64
-+              </Directory>
-+
-+virtual host:
-+      If you would like to this feature, you must describe 'Listen'
-+      part on configuration file explicitly. like below:
-+              Listen :: 80
-+              Listen 0.0.0.0 80
-+
-+    NameVirtualHost
-+      NameVirtualHost is expanded to take one more two arguments.
-+              NameVirtualHost address
-+              NameVirtualHost address:port
-+              NameVirtualHost address port
-+      This is to let you specify IPv6 address into address part.
-+
-+      Note that, if colon is found in the specified address string,
-+      the code will to resolve the address in the following way:
-+      1. try to resolve as address:port (most of IPv6 address fails)
-+      2. if (1) is failed, try to resolve as address only
-+      If there's ambiguity, i.e. 3ffe:0501::1:2, the address may not be
-+      parsed as you expect (3ffe:0501::1 with port 2, or 3ffe:0501::1:2
-+      with default port).  To get the right effect you are encouraged
-+      to specify it without ambiguity.  In IPv6 case "address port"
-+      (specify address and port separated by a space) is the safest way.
-+
-+    <VirtualHost host:port [host:port ...]>
-+      If you would like to specify IPv6 numeric address in host part,
-+      use bracketed format like below:
-+              <VirtualHost [::1]:80>
-+      Note: Now we DO NOT handle old non-bracketed format, 
-+              <VirtualHost 0:0:0:0:0:0:0:1:80>
-+            so configuration file must be updated.
-+      Note: The following is bad example to specify host ::1 port 80.
-+            This will treated as host ::1:80.
-+              <VirtualHost ::1:80>
-+
-+logresolve (src/support)
-+      error statistics in nameserver cache code is omitted.
-+
-+mod_unique_id
-+      Originally mod_unique_id used IPv4 address as a seed for UNIQUE_ID,
-+      and took IPv4 address registered onto DNS for the hostname (UNIX
-+      hostname taken by gethostname(3)).  Therefore, this does not work
-+      for IPv6-only hosts as they do not have IPv4 address for them.
-+
-+      Now, UNIQUE_ID can be generated using IPv6 address.  IPv6 address can
-+      be used as the seed for UNIQUE_ID.
-+      Because of this, UNIQUE_ID will be longer than normal apache.  This
-+      may cause problem with some of the CGI scripts.
-+      The preference of the addresses is based on the order returned
-+      by getaddrinfo().  If your getaddrinfo() returns IPv4 address, IPv4
-+      adderss will be used as a seed.
-+      Note that some of IPv6 addresses are "scoped"; If you happened to use
-+      link-local or site-local address as a seed, the UNIQUE_ID may not be
-+      worldwide unique.
-+
-+      If longer UNIQUE_ID causes a problem, define SHORT_UNIQUE_ID in
-+      mod_unique_id.c.  In this case, length of UNIQUE_ID will be kept the
-+      same.  However, for IPv6 addresses mod_unique_id.c will use the last
-+      32bit (not the whole 128bit) as the seed.  Therefore, there can be
-+      collision in UNIQUE_ID.
-+
-+      The behavior should be improved in the near future; we welcome your
-+      inputs.
-+
-+Modules known to be incompatible with IPv6
-+      (please report us)
-+
-+configure
-+      Configure has extra option, --enable-rule=INET6.  if the option
-+      is specified, IPv6 code will be enabled.
-+
-+configuration file
-+      We do not support IPv4 mapped address (IPv6 address format like
-+      ::ffff:10.1.1.1) in configuration file. 
-+
-+This kit assumes that you have working(*) getaddrinfo() and getnameinfo()
-+library functions.  Even if you don't have one, don't panic.  We have
-+included last-resort version (which support IPv4 only) into the kit.
-+For more complete implementation you might want to check BIND 8.2.
-+(*) NOTE: we have noticed that some of IPv6 stack is shipped with broken
-+getaddrinfo().  In such cases, you should get and install BIND 8.2.
-+
-+When compiling this kit onto IPv6, you may need to specify some additional
-+library paths or cpp defs (like -linet6 or -DINET6).
-+Now you don't have to specify --enable-rule=INET6.  The "configure" script
-+will give you some warnings if the IPv6 stack is not known to the 
-+"configure" script.  Currently, the following IPv6 stacks are supported:
-+- KAME IPv6 stack, http://www.kame.net/
-+      use configure.v6 for convenience,
-+- Linux IPv6 stack, http://www.linux.org/
-+      use configure.v6 for convenience.
-+- Solaris 8 IPv6 stack, http://www.sun.com/
-+      use configure.v6 for convenience.
-+To disable IPv6 support, specify --disable-rule=INET6 to the "configure"
-+script.
-+
-+CAVEAT: This patchkit may change some of apache module API, to avoid
-+IPv4-dependent structure member variable.  Please let us know if there's
-+any troubles as we know very little about the apache module API.
-+
-+Acknowledgements
-+      Thanks to all people submitted patches/fixes for this patch kit,
-+      including:
-+              "Chris P. Ross" <cross@eng.us.uu.net>
-+
-+Author contacts
-+      Jun-ichiro itojun Hagino, KAME project
-+       http://www.kame.net/
-+       mailto:core@kame.net
-+Linux Port
-+      Arkadiusz Miskiewicz, Polish Linux Distribution project (IPv6)
-+       http://www.pld.org.pl/
-+       mailto:feedback@pld.org.pl
-+      Satoshi SHIDA, Linux IPv6 Users Group JP
-+       http://www.v6.linux.or.jp/
-+      YOSHIFUJI Hideaki, USAGI Project
-+       http://www.linux-ipv6.org/
-diff -Nur apache_1.3.26.orig/conf/httpd.conf-dist apache_1.3.26/conf/httpd.conf-dist
---- apache_1.3.26.orig/conf/httpd.conf-dist    Tue Mar  5 17:19:12 2002
-+++ apache_1.3.26/conf/httpd.conf-dist Wed Jun 19 10:26:32 2002
-@@ -174,6 +174,11 @@
- #Listen 3000
- #Listen 12.34.56.78:80
-+# Listen can take two arguments.
-+# (this is an extension for supporting IPv6 addresses)
-+#Listen :: 80
-+#Listen 0.0.0.0 80
-+
- #
- # BindAddress: You can support virtual hosts with this option. This directive
- # is used to tell the server which IP address to listen to. It can either
-diff -Nur apache_1.3.26.orig/configure.v6 apache_1.3.26/configure.v6
---- apache_1.3.26.orig/configure.v6    Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/configure.v6 Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,3 @@
-+#! /bin/sh
-+
-+./configure --enable-rule=INET6 --enable-module=proxy $*
-diff -Nur apache_1.3.26.orig/src/Configuration.tmpl apache_1.3.26/src/Configuration.tmpl
---- apache_1.3.26.orig/src/Configuration.tmpl  Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/Configuration.tmpl       Wed Jun 19 10:26:32 2002
-@@ -191,6 +191,9 @@
- #  Rule EXPAT=default   : If Expat can be found at the system or
- #                         in lib/expat-lite, use it; otherwise
- #                         skip it
-+# INET6:
-+#  IPv6 support.
-+#
- # 
- # CYGWIN_WINSOCK: 
- #  Use Win32 API system calls for socket communication instead 
-@@ -205,6 +208,7 @@
- Rule IRIXN32=yes
- Rule PARANOID=no
- Rule EXPAT=default
-+Rule INET6=no
- Rule CYGWIN_WINSOCK=no 
- # DEV_RANDOM:
-diff -Nur apache_1.3.26.orig/src/Configure apache_1.3.26/src/Configure
---- apache_1.3.26.orig/src/Configure   Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/Configure        Wed Jun 19 10:26:32 2002
-@@ -238,6 +238,7 @@
- RULE_CYGWIN_WINSOCK=`./helpers/CutRule CYGWIN_WINSOCK $file` 
- RULE_SHARED_CORE=`./helpers/CutRule SHARED_CORE $file`
- RULE_SHARED_CHAIN=`./helpers/CutRule SHARED_CHAIN $file`
-+RULE_INET6=`./helpers/CutRule INET6 $file`
- ####################################################################
- ## Rule SHARED_CORE implies required DSO support
-@@ -1701,6 +1702,124 @@
-     esac
- fi
-+# INET6 support.
-+if [ "$RULE_INET6" = "yes" ]; then
-+    echo " + enabling INET6 support"
-+    CFLAGS="$CFLAGS -DINET6"
-+    CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len"
-+    IPV6_STACKTYPE="UNKNOWN"
-+    for i in KAME Linux Solaris; do
-+      case "$i" in
-+      KAME)
-+          if [ -f /usr/include/netinet6/in6.h -a "x`egrep '__KAME__' /usr/include/netinet6/in6.h 2>/dev/null`" != "x" ]; then
-+              IPV6_STACKTYPE=$i
-+          fi
-+          ;;
-+      Linux)
-+          if [ /usr/include/netinet/ip6.h -a -d /usr/include/linux ]; then
-+              IPV6_STACKTYPE=$i
-+          fi
-+          ;;
-+      Solaris)
-+          SOL_VERSION=`(uname -v) 2>/dev/null` || SOL_VERSION="unknown"
-+          case "${PLAT}-${SOL_VERSION}" in
-+              *-solaris2.27*-*IPv6*)
-+                  if [ -f /etc/hostname -o -f /etc/hostname.[a-z]*[0-9] ]; then
-+                      IPV6_STACKTYPE="Solaris 7 (${SOL_VERSION})"
-+                  fi
-+                  ;;
-+          esac
-+          ;;
-+      esac
-+      if [ "$IPV6_STACKTYPE" != "UNKNOWN" ]; then
-+          break
-+      fi
-+    done
-+    if [ "$IPV6_STACKTYPE" != "UNKNOWN" ]; then
-+      echo " + You seem to be using $IPV6_STACKTYPE stack"
-+      if ./helpers/TestCompile func getaddrinfo; then
-+          echo "   - Assuming you have working getaddrinfo in libc" 
-+      else
-+          if [ -f /usr/local/v6/lib/libinet6.a -a "x`egrep '^EXTRA_L' Makefile.config | grep linet6`" = "x" ]; then
-+              LIBS="$LIBS -L/usr/local/v6/lib -linet6"
-+              echo "   - using getaddrinfo in libinet6" 
-+          elif [ -f /usr/local/lib/libinet6.a -a "x`egrep '^EXTRA_L' Makefile.config | grep linet6`" = "x" ]; then
-+              LIBS="$LIBS -L/usr/local/lib -linet6"
-+              echo "   - using getaddrinfo in libinet6"
-+          elif [ -f /usr/inet6/lib/libinet6.a -a "x`egrep '^EXTRA_L' Makefile.config | grep linet6`" = "x" ]; then
-+              echo "   - using getaddrinfo in libinet6"
-+          else
-+              echo "** WARNING: No getaddrinfo found, linkage may fail" 
-+          fi
-+      fi
-+    else
-+      echo ""
-+      echo "** WARNING: We have no explicit knowledge about the IPv6"
-+      echo "** implementation on this host.  You may need to specify"
-+      echo "** EXTRA_LIBS so that we can find getaddrinfo() and"
-+      echo "** getnameinfo() library functions."
-+      echo ""
-+    fi
-+    case $PLAT in
-+      *-solaris2* )
-+          LIBS="$LIBS -lresolv"
-+          ;;
-+    esac
-+else
-+    CFLAGS="$CFLAGS -DNEED_GETADDRINFO -DNEED_GETNAMEINFO"
-+    if [ -f /usr/include/netdb.h -a "x`egrep 'addrinfo' /usr/include/netdb.h`" = "x" ]; then
-+      CFLAGS="$CFLAGS -DNEED_ADDRINFO"
-+    fi
-+fi
-+
-+echo '#include <sys/types.h>' >testfunc.c
-+echo '#include <sys/socket.h>' >>testfunc.c
-+echo 'int testfunc(){ struct sockaddr sa; int i = sa.sa_len; };' >>testfunc.c
-+rm -f testfunc.o
-+eval "${MAKE-make} -f Makefile.config testfunc.o >/dev/null 2>/dev/null"
-+if [ -f testfunc.o ]; then
-+    echo " + you have sa_len in struct sockaddr."
-+    CFLAGS="$CFLAGS -DHAVE_SOCKADDR_LEN"
-+else
-+    echo " + you don't have sa_len in struct sockaddr."
-+fi
-+rm -f testfunc.c testfunc.o
-+
-+echo '#include <sys/types.h>' >testfunc.c
-+echo '#include <sys/socket.h>' >>testfunc.c
-+echo 'struct sockaddr_storage sockaddr_storage;' >>testfunc.c
-+rm -f testfunc.o
-+eval "${MAKE-make} -f Makefile.config testfunc.o >/dev/null 2>/dev/null"
-+if [ -f testfunc.o ]; then
-+    echo " + assuming you have struct sockaddr_storage"
-+else
-+    CFLAGS="$CFLAGS -DNEED_SOCKADDR_STORAGE"
-+    echo " + you need struct sockaddr_storage"
-+fi
-+rm -f testfunc.c testfunc.o
-+
-+echo '#include <sys/types.h>' >testfunc.c
-+echo '#include <sys/socket.h>' >>testfunc.c
-+echo 'int testfunc(){ socklen_t t; }' >>testfunc.c
-+rm -f testfunc.o
-+eval "${MAKE-make} -f Makefile.config testfunc.o >/dev/null 2>/dev/null"
-+if [ ! -f testfunc.o ]; then
-+    CFLAGS="$CFLAGS -Dsocklen_t=int"
-+fi
-+rm -f testfunc.c testfunc.o
-+
-+echo '#include <sys/types.h>' >testfunc.c
-+echo '#include <sys/socket.h>' >>testfunc.c
-+echo 'struct sockaddr_in sin;' >>testfunc.c
-+echo 'int main(){ int i = sin.sin_len; }' >>testfunc.c
-+rm -f testfunc.o
-+eval "${MAKE-make} -f Makefile.config testfunc.o >/dev/null 2>/dev/null"
-+if [ -f testfunc.o ]; then
-+    CFLAGS="$CFLAGS -DSIN_LEN"
-+fi
-+rm -f testfunc.c testfunc.o
-+
-+
- ####################################################################
- ## Find out what modules we want and try and configure things for them
- ## Module lines can look like this:
-@@ -2296,6 +2415,38 @@
- echo "#define AP_LONGEST_LONG $AP_LONGEST_LONG" >>$AP_CONFIG_AUTO_H
- echo "#endif" >>$AP_CONFIG_AUTO_H
-+if [ x`./helpers/TestCompile -r sizeof 'uint32_t'` != x"" ]; then
-+    echo "" >>$AP_CONFIG_AUTO_H
-+    echo "/* determine: use uint32_t as 32bit unsigned int */" >>$AP_CONFIG_AUTO_H
-+    echo "#ifndef ap_uint32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#define ap_uint32_t uint32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#endif" >>$AP_CONFIG_AUTO_H
-+    echo "   - use uint32_t as 32bit unsigned int"
-+elif [ x`./helpers/TestCompile -r sizeof 'u_int32_t'` != x"" ]; then
-+    echo "" >>$AP_CONFIG_AUTO_H
-+    echo "/* determine: use u_int32_t as 32bit unsigned int */" >>$AP_CONFIG_AUTO_H
-+    echo "#ifndef ap_uint32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#define ap_uint32_t u_int32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#endif" >>$AP_CONFIG_AUTO_H
-+    echo "   - use u_int32_t as 32bit unsigned int"
-+elif [ x`./helpers/TestCompile -r sizeof 'unsigned int'` = x"4" ]; then
-+    echo "" >>$AP_CONFIG_AUTO_H
-+    echo "/* determine: use unsigned int as 32bit unsigned int */" >>$AP_CONFIG_AUTO_H
-+    echo "#ifndef ap_uint32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#define ap_uint32_t unsigned int" >>$AP_CONFIG_AUTO_H
-+    echo "#endif" >>$AP_CONFIG_AUTO_H
-+    echo "   - use unsigned int as 32bit unsigned int"
-+elif [ x`./helpers/TestCompile -r sizeof 'unsigned long int'` = x"4" ]; then
-+    echo "" >>$AP_CONFIG_AUTO_H
-+    echo "/* determine: use unsigned long int as 32bit unsigned int */" >>$AP_CONFIG_AUTO_H
-+    echo "#ifndef uint32_t" >>$AP_CONFIG_AUTO_H
-+    echo "#define uint32_t unsigned long int" >>$AP_CONFIG_AUTO_H
-+    echo "#endif" >>$AP_CONFIG_AUTO_H
-+    echo "   - use unsigned long int as 32bit unsigned int"
-+else
-+    echo "  - Warning: cannot determine what type should we use as 32bit unsigned int"
-+fi
-+
- ####################################################################
- ## More building ap_config_auto.h
- ##
-diff -Nur apache_1.3.26.orig/src/ap/ap_snprintf.c apache_1.3.26/src/ap/ap_snprintf.c
---- apache_1.3.26.orig/src/ap/ap_snprintf.c    Thu Mar 14 13:08:06 2002
-+++ apache_1.3.26/src/ap/ap_snprintf.c Wed Jun 19 10:26:32 2002
-@@ -73,6 +73,7 @@
- #include <string.h>
- #include <stdlib.h>
- #include <math.h>
-+#include "sa_len.h"
- #ifdef WIN32
- #include <float.h>
- #endif
-@@ -504,6 +505,42 @@
-+#ifdef INET6
-+static char *conv_sockaddr(struct sockaddr *sa, char *buf_end, int *len)
-+{
-+    char *p = buf_end;
-+    char hostnamebuf[MAXHOSTNAMELEN];
-+    char portnamebuf[MAXHOSTNAMELEN];
-+    char *q;
-+    int salen;
-+
-+#ifndef SIN6_LEN
-+    salen = SA_LEN(sa);
-+#else
-+    salen = sa->sa_len;
-+#endif
-+    if (getnameinfo(sa, salen, hostnamebuf, sizeof(hostnamebuf),
-+          portnamebuf, sizeof(portnamebuf), NI_NUMERICHOST | NI_NUMERICSERV)) {
-+      strcpy(hostnamebuf, "???");
-+      strcpy(portnamebuf, "???");
-+    }
-+    if (strcmp(portnamebuf,"0") == 0)
-+      strcpy(portnamebuf, "*");
-+    q = portnamebuf + strlen(portnamebuf);
-+    while (portnamebuf < q)
-+      *--p = *--q;
-+    *--p = ':';
-+    q = hostnamebuf + strlen(hostnamebuf);
-+    while (hostnamebuf < q)
-+      *--p = *--q;
-+
-+    *len = buf_end - p;
-+    return (p);
-+}
-+#endif /*INET6*/
-+
-+
-+
- /*
-  * Convert a floating point number to a string formats 'f', 'e' or 'E'.
-  * The result is placed in buf, and len denotes the length of the string
-@@ -1055,6 +1092,7 @@
-                   /* print a struct sockaddr_in as a.b.c.d:port */
-               case 'I':
-                   {
-+#ifndef INET6
-                       struct sockaddr_in *si;
-                       si = va_arg(ap, struct sockaddr_in *);
-@@ -1063,6 +1101,16 @@
-                           if (adjust_precision && precision < s_len)
-                               s_len = precision;
-                       }
-+#else
-+                      struct sockaddr *sa;
-+
-+                      sa = va_arg(ap, struct sockaddr *);
-+                      if (sa != NULL) {
-+                          s = conv_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len);
-+                          if (adjust_precision && precision < s_len)
-+                              s_len = precision;
-+                      }
-+#endif
-                       else {
-                           s = S_NULL;
-                           s_len = S_NULL_LEN;
-diff -Nur apache_1.3.26.orig/src/include/ap.h apache_1.3.26/src/include/ap.h
---- apache_1.3.26.orig/src/include/ap.h        Tue Jun 18 06:19:45 2002
-+++ apache_1.3.26/src/include/ap.h     Wed Jun 19 10:26:32 2002
-@@ -95,7 +95,8 @@
-  * with some extensions.  The extensions are:
-  *
-  * %pA        takes a struct in_addr *, and prints it as a.b.c.d
-- * %pI        takes a struct sockaddr_in * and prints it as a.b.c.d:port
-+ * %pI        takes a struct sockaddr * and prints it as a.b.c.d:port, or
-+ *    ipv6-numeric-addr:port
-  * %pp  takes a void * and outputs it in hex
-  *
-  * The %p hacks are to force gcc's printf warning code to skip
-diff -Nur apache_1.3.26.orig/src/include/ap_config.h apache_1.3.26/src/include/ap_config.h
---- apache_1.3.26.orig/src/include/ap_config.h Mon Jun  3 14:28:27 2002
-+++ apache_1.3.26/src/include/ap_config.h      Wed Jun 19 10:26:32 2002
-@@ -407,6 +407,10 @@
- #endif
- #ifndef S_IWOTH
- #define S_IWOTH 000002
-+#ifndef rlim_t
-+typedef int rlim_t;
-+#endif
-+typedef u_long n_long;
- #endif
- #define STDIN_FILENO  0
-@@ -1509,6 +1513,70 @@
- #define ap_wait_t int
- #endif
-+#ifndef INET6
-+#define sockaddr_storage      sockaddr
-+#define ss_family             sa_family
-+#define ss_len                        sa_len
-+#else
-+#include "sockaddr_storage.h" /* sshida@st.rim.or.jp */
-+#endif
-+
-+#ifndef INET6_ADDRSTRLEN
-+#define INET6_ADDRSTRLEN      46
-+#endif
-+#ifndef INET_ADDRSTRLEN
-+#define INET_ADDRSTRLEN               16
-+#endif
-+#ifndef NI_MAXHOST
-+#define NI_MAXHOST            1025
-+#endif
-+#ifndef NI_MAXSERV
-+#define       NI_MAXSERV              32
-+#endif
-+
-+#if defined(NEED_GETADDRINFO) || defined(NEED_GETNAMEINFO)
-+/*
-+ * minimal definitions for fake getaddrinfo()/getnameinfo().
-+ */
-+#ifndef EAI_NODATA
-+#define EAI_NODATA    1
-+#define EAI_MEMORY    2
-+#endif
-+
-+#ifndef AI_PASSIVE
-+#define AI_PASSIVE    1
-+#define AI_CANONNAME  2
-+#define AI_NUMERICHOST        4
-+#define NI_NUMERICHOST        8
-+#define NI_NAMEREQD   16
-+#define NI_NUMERICSERV        32
-+#endif
-+#endif
-+
-+#ifdef NEED_GETADDRINFO
-+#ifdef NEED_ADDRINFO
-+struct addrinfo {
-+      int     ai_flags;       /* AI_PASSIVE, AI_CANONNAME */
-+      int     ai_family;      /* PF_xxx */
-+      int     ai_socktype;    /* SOCK_xxx */
-+      int     ai_protocol;    /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
-+      size_t  ai_addrlen;     /* length of ai_addr */
-+      char    *ai_canonname;  /* canonical name for hostname */
-+      struct sockaddr *ai_addr;       /* binary address */
-+      struct addrinfo *ai_next;       /* next structure in linked list */
-+};
-+#endif
-+extern char *gai_strerror(int ecode);
-+extern void freeaddrinfo(struct addrinfo *ai);
-+extern int getaddrinfo(const char *hostname, const char *servname,
-+      const struct addrinfo *hints, struct addrinfo **res);
-+#endif
-+#ifdef NEED_GETNAMEINFO
-+extern int getnameinfo(const struct sockaddr *sa, size_t salen,
-+      char *host, size_t hostlen, char *serv, size_t servlen,
-+      int flag);
-+#endif
-+
- #ifdef __cplusplus
- }
- #endif
-diff -Nur apache_1.3.26.orig/src/include/http_conf_globals.h apache_1.3.26/src/include/http_conf_globals.h
---- apache_1.3.26.orig/src/include/http_conf_globals.h Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/include/http_conf_globals.h      Wed Jun 19 10:26:32 2002
-@@ -82,7 +82,8 @@
- extern API_VAR_EXPORT int ap_max_requests_per_child;
- extern API_VAR_EXPORT int ap_threads_per_child;
- extern API_VAR_EXPORT int ap_excess_requests_per_child;
--extern API_VAR_EXPORT struct in_addr ap_bind_address;
-+extern API_VAR_EXPORT struct sockaddr_storage ap_bind_address;
-+extern API_VAR_EXPORT int ap_default_family;
- extern listen_rec *ap_listeners;
- extern API_VAR_EXPORT int ap_daemons_to_start;
- extern API_VAR_EXPORT int ap_daemons_min_free;
-diff -Nur apache_1.3.26.orig/src/include/http_vhost.h apache_1.3.26/src/include/http_vhost.h
---- apache_1.3.26.orig/src/include/http_vhost.h        Wed Mar 13 22:05:29 2002
-+++ apache_1.3.26/src/include/http_vhost.h     Wed Jun 19 10:26:32 2002
-@@ -73,7 +73,7 @@
- API_EXPORT(const char *) ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s);
- /* handle NameVirtualHost directive */
--API_EXPORT_NONSTD(const char *) ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg);
-+API_EXPORT_NONSTD(const char *) ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *h, char *p);
- /* given an ip address only, give our best guess as to what vhost it is */
- API_EXPORT(void) ap_update_vhost_given_ip(conn_rec *conn);
-diff -Nur apache_1.3.26.orig/src/include/httpd.h apache_1.3.26/src/include/httpd.h
---- apache_1.3.26.orig/src/include/httpd.h     Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/include/httpd.h  Wed Jun 19 10:26:32 2002
-@@ -903,8 +903,8 @@
-     /* Who is the client? */
--    struct sockaddr_in local_addr;    /* local address */
--    struct sockaddr_in remote_addr;   /* remote address */
-+    struct sockaddr_storage local_addr;       /* local address */
-+    struct sockaddr_storage remote_addr; /* remote address */
-     char *remote_ip;          /* Client's IP address */
-     char *remote_host;                /* Client's DNS name, if known.
-                                * NULL if DNS hasn't been checked,
-@@ -946,8 +946,8 @@
- typedef struct server_addr_rec server_addr_rec;
- struct server_addr_rec {
-     server_addr_rec *next;
--    struct in_addr host_addr; /* The bound address, for this server */
--    unsigned short host_port; /* The bound port, for this server */
-+    struct sockaddr_storage host_addr;        /* The bound address, for this server */
-+    unsigned short host_port; /* The bound port, for this server XXX */
-     char *virthost;           /* The name given in <VirtualHost> */
- };
-@@ -1015,7 +1015,7 @@
- /* These are more like real hosts than virtual hosts */
- struct listen_rec {
-     listen_rec *next;
--    struct sockaddr_in local_addr;    /* local IP address and port */
-+    struct sockaddr_storage local_addr;       /* local IP address and port */
-     int fd;
-     int used;                 /* Only used during restart */        
- /* more stuff here, like which protocol is bound to the port */
-@@ -1183,7 +1183,7 @@
- #endif /*#ifdef CHARSET_EBCDIC*/
- API_EXPORT(char *) ap_get_local_host(pool *);
--API_EXPORT(unsigned long) ap_get_virthost_addr(char *hostname, unsigned short *port);
-+API_EXPORT(struct sockaddr *) ap_get_virthost_addr(char *hostname, unsigned short *port);
- extern API_VAR_EXPORT time_t ap_restart_time;
-diff -Nur apache_1.3.26.orig/src/include/sa_len.h apache_1.3.26/src/include/sa_len.h
---- apache_1.3.26.orig/src/include/sa_len.h    Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/src/include/sa_len.h Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,41 @@
-+/* sa_len.h : tiny version of SA_LEN (written by <yoshfuji@ecei.tohoku.ac.jp>) */
-+ 
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <sys/un.h>
-+
-+#ifndef HAVE_SOCKADDR_LEN
-+#ifndef SA_LEN
-+#define SA_LEN(s_)    ap_sa_len((s_)->sa_family)
-+
-+static NET_SIZE_T ap_sa_len (sa_family_t af)
-+{
-+    switch (af){
-+#if defined(AF_INET)
-+    case AF_INET:
-+      return (sizeof(struct sockaddr_in));
-+#endif /* AF_INET */
-+#if defined(AF_INET6)
-+    case AF_INET6:
-+      return (sizeof(struct sockaddr_in6));
-+#endif
-+#ifdef AF_LOCAL
-+    case AF_LOCAL:
-+#endif /* AF_LOCAL */
-+#if defined(AF_UNIX) && (AF_UNIX != AF_LOCAL)
-+    case AF_UNIX:
-+#endif /* AF_UNIX */
-+#if defined(AF_FILE) && (AF_FILE != AF_LOCAL || AF_FILE != AF_UNIX)
-+    case AF_FILE:
-+#endif /* AF_FILE */
-+#if defined(AF_LOCAL) || defined(AF_UNIX) || defined(AF_FILE)
-+      return (sizeof(struct sockaddr_un));
-+#endif /* defined(AF_LOCAL) || defined(AF_UNIX) || defined(AF_FILE) */
-+    default:
-+      return 0;
-+    }
-+    return 0;
-+}
-+#endif /* SA_LEN */
-+#endif /* HAVE_SOCKADDR_LEN */
-diff -Nur apache_1.3.26.orig/src/include/sockaddr_storage.h apache_1.3.26/src/include/sockaddr_storage.h
---- apache_1.3.26.orig/src/include/sockaddr_storage.h  Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/src/include/sockaddr_storage.h       Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,53 @@
-+/*
-+struct sockaddr_storage
-+
-+   RFC2553 proposes struct sockaddr_storage.
-+   This is a placeholder for all sockaddr-variant structures. This is
-+   implemented like follows:
-+
-+   You should use this structure to hold any of sockaddr-variant
-+   structures.
-+*/
-+#ifdef NEED_SOCKADDR_STORAGE
-+
-+struct sockaddr_storage {
-+#ifdef HAVE_SOCKADDR_LEN
-+      u_char ss_len;
-+      u_char ss_family;
-+#else
-+      u_short ss_family;
-+#endif
-+      u_char __padding[128 - 2];
-+};
-+
-+/*
-+union sockunion
-+
-+   Alternatively, you may want to implement sockunion.h, with the
-+   following content:
-+
-+   NOTE: For better portability, struct sockaddr_storage should be used.
-+   union sockunion is okay, but is not really portable enough.
-+*/
-+union sockunion {
-+      struct sockinet {
-+#ifdef HAVE_SOCKADDR_LEN
-+              u_char si_len;
-+              u_char si_family;
-+#else
-+              u_short si_family;
-+#endif
-+              u_short si_port;
-+      } su_si;
-+      struct sockaddr_in  su_sin;
-+#ifdef INET6
-+      struct sockaddr_in6 su_sin6;
-+#endif
-+};
-+#ifdef HAVE_SOCKADDR_LEN
-+#define su_len                su_si.si_len
-+#endif
-+#define su_family     su_si.si_family
-+#define su_port               su_si.si_port
-+
-+#endif /* NEED_SOCKADDR_STORAGE */
-diff -Nur apache_1.3.26.orig/src/main/getaddrinfo.c apache_1.3.26/src/main/getaddrinfo.c
---- apache_1.3.26.orig/src/main/getaddrinfo.c  Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/src/main/getaddrinfo.c       Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,162 @@
-+/*
-+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
-+ * 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. Neither the name of the project nor the names of its contributors
-+ *    may be used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ * 
-+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS 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 PROJECT OR 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.
-+ */
-+/*
-+ * fake library for ssh v6 enabler patch
-+ *
-+ * This file includes getaddrinfo(), freeaddrinfo() and gai_strerror().
-+ * These funtions are defined in rfc2133.
-+ *
-+ * But these functions are not implemented correctly. The minimum subset
-+ * is implemented for ssh use only. For exapmle, this routine assumes
-+ * that ai_family is AF_INET. Don't use it for another purpose.
-+ * 
-+ * In the case not using 'configure --enable-ipv6', this getaddrinfo.c
-+ * will be used if you have broken getaddrinfo or no getaddrinfo.
-+ */
-+
-+#if 0
-+#include <stdlib.h>
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <netdb.h>
-+#include "gai.h"
-+#endif
-+
-+static struct addrinfo *
-+malloc_ai(port, addr, socktype, protocol)
-+int port;
-+u_long addr;
-+int socktype;
-+int protocol;
-+{
-+  struct addrinfo *ai;
-+
-+  if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) +
-+                                   sizeof(struct sockaddr_in))) {
-+    memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in));
-+    ai->ai_addr = (struct sockaddr *)(ai + 1);
-+#if defined(HAVE_SOCKADDR_LEN)
-+    ai->ai_addr->sa_len = 
-+#endif
-+      ai->ai_addrlen = sizeof(struct sockaddr_in);
-+    ai->ai_addr->sa_family = ai->ai_family = AF_INET;
-+    ai->ai_socktype = socktype;
-+    ai->ai_protocol = protocol;
-+    ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port;
-+    ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr;
-+    return ai;
-+  } else {
-+    return NULL;
-+  }
-+}
-+
-+char *
-+gai_strerror(ecode)
-+int ecode;
-+{
-+  switch (ecode) {
-+  case EAI_NODATA:
-+    return "no address associated with hostname.";
-+  case EAI_MEMORY:
-+    return "memory allocation failure.";
-+  default:
-+    return "unknown error.";
-+  }
-+}    
-+
-+void
-+freeaddrinfo(ai)
-+struct addrinfo *ai;
-+{
-+  struct addrinfo *next;
-+  
-+  do {
-+    next = ai->ai_next;
-+    free(ai);
-+  } while (ai = next);
-+}
-+
-+int
-+getaddrinfo(hostname, servname, hints, res)
-+const char *hostname, *servname;
-+const struct addrinfo *hints;
-+struct addrinfo **res;
-+{
-+  struct addrinfo *cur, *prev = NULL;
-+  struct hostent *hp;
-+  int i, port;
-+  
-+  if (servname)
-+    port = htons(atoi(servname));
-+  else
-+    port = 0;
-+  if (hints && hints->ai_flags & AI_PASSIVE)
-+    if (*res = malloc_ai(port, htonl(0x00000000), 
-+                       (*res)->ai_socktype ? (*res)->ai_socktype : SOCK_STREAM,
-+                       (*res)->ai_protocol))
-+      return 0;
-+    else
-+      return EAI_MEMORY;
-+  if (!hostname)
-+    if (*res = malloc_ai(port, htonl(0x7f000001),
-+                       (*res)->ai_socktype ? (*res)->ai_socktype : SOCK_STREAM,
-+                       (*res)->ai_protocol))
-+      return 0;
-+    else
-+      return EAI_MEMORY;
-+  if (inet_addr(hostname) != -1)
-+    if (*res = malloc_ai(port, inet_addr(hostname),
-+                       (*res)->ai_socktype ? (*res)->ai_socktype : SOCK_STREAM,
-+                       (*res)->ai_protocol))
-+      return 0;
-+    else
-+      return EAI_MEMORY;
-+  if ((hp = gethostbyname(hostname)) &&
-+      hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
-+    for (i = 0; hp->h_addr_list[i]; i++)
-+      if (cur = malloc_ai(port,
-+                        ((struct in_addr *)hp->h_addr_list[i])->s_addr,
-+                        (*res)->ai_socktype ? (*res)->ai_socktype : SOCK_STREAM,
-+                        (*res)->ai_protocol)) {
-+      if (prev)
-+        prev->ai_next = cur;
-+      else
-+        *res = cur;
-+      prev = cur;
-+      } else {
-+      if (*res)
-+        freeaddrinfo(*res);
-+      return EAI_MEMORY;
-+      }
-+    return 0;
-+  }
-+  return EAI_NODATA;
-+}
-diff -Nur apache_1.3.26.orig/src/main/getnameinfo.c apache_1.3.26/src/main/getnameinfo.c
---- apache_1.3.26.orig/src/main/getnameinfo.c  Thu Jan  1 01:00:00 1970
-+++ apache_1.3.26/src/main/getnameinfo.c       Wed Jun 19 10:26:32 2002
-@@ -0,0 +1,95 @@
-+/*
-+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
-+ * 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. Neither the name of the project nor the names of its contributors
-+ *    may be used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ * 
-+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS 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 PROJECT OR 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.
-+ */
-+/*
-+ * fake library for ssh v6 enabler patch
-+ *
-+ * This file includes getnameinfo().
-+ * These funtions are defined in rfc2133.
-+ *
-+ * But these functions are not implemented correctly. The minimum subset
-+ * is implemented for ssh use only. For exapmle, this routine assumes
-+ * that ai_family is AF_INET. Don't use it for another purpose.
-+ * 
-+ * In the case not using 'configure --enable-ipv6', this getnameinfo.c
-+ * will be used if you have broken getnameinfo or no getnameinfo.
-+ */
-+
-+#if 0
-+#include <stdlib.h>
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+#include <netdb.h>
-+#include <string.h>
-+#include "gai.h"
-+#endif
-+
-+int
-+getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
-+const struct sockaddr *sa;
-+size_t salen;
-+char *host;
-+size_t hostlen;
-+char *serv;
-+size_t servlen;
-+int flags;
-+{
-+  struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-+  struct hostent *hp;
-+  char tmpserv[16];
-+  
-+  if (serv) {
-+    sprintf(tmpserv, "%d", ntohs(sin->sin_port));
-+    if (strlen(tmpserv) > servlen)
-+      return EAI_MEMORY;
-+    else
-+      strcpy(serv, tmpserv);
-+  }
-+  if (host)
-+    if (flags & NI_NUMERICHOST)
-+      if (strlen(inet_ntoa(sin->sin_addr)) > hostlen)
-+      return EAI_MEMORY;
-+      else {
-+      strcpy(host, inet_ntoa(sin->sin_addr));
-+      return 0;
-+      }
-+    else
-+      if (hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr),
-+                           AF_INET))
-+      if (strlen(hp->h_name) > hostlen)
-+        return EAI_MEMORY;
-+      else {
-+        strcpy(host, hp->h_name);
-+        return 0;
-+      }
-+      else
-+      return EAI_NODATA;
-+  return 0;
-+}
-diff -Nur apache_1.3.26.orig/src/main/http_config.c apache_1.3.26/src/main/http_config.c
---- apache_1.3.26.orig/src/main/http_config.c  Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/main/http_config.c       Wed Jun 19 10:26:32 2002
-@@ -1564,7 +1564,6 @@
-     ap_scoreboard_fname = DEFAULT_SCOREBOARD;
-     ap_lock_fname = DEFAULT_LOCKFILE;
-     ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
--    ap_bind_address.s_addr = htonl(INADDR_ANY);
-     ap_listeners = NULL;
-     ap_listenbacklog = DEFAULT_LISTENBACKLOG;
-     ap_extended_status = 0;
-@@ -1597,7 +1596,13 @@
-     s->next = NULL;
-     s->addrs = ap_pcalloc(p, sizeof(server_addr_rec));
-     /* NOT virtual host; don't match any real network interface */
--    s->addrs->host_addr.s_addr = htonl(INADDR_ANY);
-+    memset(&s->addrs->host_addr, 0, sizeof(s->addrs->host_addr));
-+#if 0
-+    s->addrs->host_addr.ss_family = ap_default_family; /* XXX: needed?, XXX: PF_xxx can be different from AF_xxx */
-+#endif
-+#ifdef HAVE_SOCKADDR_LEN
-+    s->addrs->host_addr.ss_len = sizeof(s->addrs->host_addr); /* XXX: needed ? */
-+#endif
-     s->addrs->host_port = 0;  /* matches any port */
-     s->addrs->virthost = "";  /* must be non-NULL */
-     s->names = s->wild_names = NULL;
-@@ -1616,21 +1621,33 @@
- static void default_listeners(pool *p, server_rec *s)
- {
-     listen_rec *new;
-+    struct addrinfo hints, *res0, *res;
-+    int gai;
-+    char servbuf[NI_MAXSERV];
-     if (ap_listeners != NULL) {
-       return;
-     }
-+    ap_snprintf(servbuf, sizeof(servbuf), "%d", s->port ? s->port : DEFAULT_HTTP_PORT);
-+    memset (&hints, 0, sizeof(hints));
-+    hints.ai_family = ap_default_family;
-+    hints.ai_socktype = SOCK_STREAM;
-+    hints.ai_flags = AI_PASSIVE;
-+    gai = getaddrinfo(NULL, servbuf, &hints, &res0);
-+    if (gai){
-+      fprintf(stderr, "default_listeners(): getaddrinfo(PASSIVE) for family %u: %s\n",
-+              gai_strerror(gai), ap_default_family);
-+      exit (1);
-+    }
-     /* allocate a default listener */
-     new = ap_pcalloc(p, sizeof(listen_rec));
--    new->local_addr.sin_family = AF_INET;
--    new->local_addr.sin_addr = ap_bind_address;
--    /* Buck ugly cast to get around terniary op bug in some (MS) compilers */
--    new->local_addr.sin_port = htons((unsigned short)(s->port ? s->port 
--                                                        : DEFAULT_HTTP_PORT));
-+    memcpy(&new->local_addr, res0->ai_addr, res0->ai_addrlen);
-     new->fd = -1;
-     new->used = 0;
-     new->next = NULL;
-     ap_listeners = new;
-+
-+    freeaddrinfo(res0);
- }
-diff -Nur apache_1.3.26.orig/src/main/http_core.c apache_1.3.26/src/main/http_core.c
---- apache_1.3.26.orig/src/main/http_core.c    Tue Jun 18 02:59:57 2002
-+++ apache_1.3.26/src/main/http_core.c Wed Jun 19 10:26:32 2002
-@@ -71,6 +71,7 @@
- #include "util_md5.h"
- #include "scoreboard.h"
- #include "fnmatch.h"
-+#include "sa_len.h"
- #ifdef USE_MMAP_FILES
- #include <sys/mman.h>
-@@ -638,7 +639,9 @@
-  */
- static ap_inline void do_double_reverse (conn_rec *conn)
- {
--    struct hostent *hptr;
-+    struct addrinfo hints, *res, *res0;
-+    char hostbuf1[128], hostbuf2[128]; /* INET6_ADDRSTRLEN(=46) is enough */
-+    int ok = 0;
-     if (conn->double_reverse) {
-       /* already done */
-@@ -650,19 +653,43 @@
-         conn->remote_host = ""; /* prevent another lookup */
-       return;
-     }
--    hptr = gethostbyname(conn->remote_host);
--    if (hptr) {
--      char **haddr;
--
--      for (haddr = hptr->h_addr_list; *haddr; haddr++) {
--          if (((struct in_addr *)(*haddr))->s_addr
--              == conn->remote_addr.sin_addr.s_addr) {
--              conn->double_reverse = 1;
--              return;
--          }
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = PF_UNSPEC;
-+    hints.ai_socktype = SOCK_STREAM;
-+    if (getaddrinfo(conn->remote_host, NULL, &hints, &res0)) {
-+      conn->double_reverse = -1;
-+      return;
-+    }
-+    for (res = res0; res; res = res->ai_next) {
-+      if (res->ai_addr->sa_family != conn->remote_addr.ss_family ||
-+          !(res->ai_family == AF_INET 
-+#ifdef INET6
-+            || res->ai_family == AF_INET6
-+#endif
-+            )
-+          )
-+          continue;
-+#ifndef HAVE_SOCKADDR_LEN
-+      if (res->ai_addrlen != SA_LEN((struct sockaddr *)&conn->remote_addr))
-+#else
-+      if (res->ai_addr->sa_len != conn->remote_addr.ss_len)
-+#endif
-+          continue;
-+      if (getnameinfo(res->ai_addr, res->ai_addrlen,
-+            hostbuf1, sizeof(hostbuf1), NULL, 0,
-+            NI_NUMERICHOST))
-+          continue;
-+      if (getnameinfo(((struct sockaddr *)&conn->remote_addr), res->ai_addrlen,
-+            hostbuf2, sizeof(hostbuf2), NULL, 0,
-+            NI_NUMERICHOST))
-+          continue;
-+      if (strcmp(hostbuf1, hostbuf2) == 0){
-+          ok = 1;
-+          break;
-       }
-     }
--    conn->double_reverse = -1;
-+    conn->double_reverse = ok ? 1 : -1;
-+    freeaddrinfo(res0);
-     /* invalidate possible reverse-resolved hostname if forward lookup fails */
-     conn->remote_host = "";
- }
-@@ -670,10 +697,9 @@
- API_EXPORT(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
-                                           int type)
- {
--    struct in_addr *iaddr;
--    struct hostent *hptr;
-     int hostname_lookups;
-     int old_stat = SERVER_DEAD;       /* we shouldn't ever be in this state */
-+    char hostnamebuf[MAXHOSTNAMELEN];
-     /* If we haven't checked the host name, and we want to */
-     if (dir_config) {
-@@ -695,10 +721,14 @@
-           || hostname_lookups != HOSTNAME_LOOKUP_OFF)) {
-       old_stat = ap_update_child_status(conn->child_num, SERVER_BUSY_DNS,
-                                         (request_rec*)NULL);
--      iaddr = &(conn->remote_addr.sin_addr);
--      hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr), AF_INET);
--      if (hptr != NULL) {
--          conn->remote_host = ap_pstrdup(conn->pool, (void *)hptr->h_name);
-+      if (!getnameinfo((struct sockaddr *)&conn->remote_addr,
-+#ifndef SIN6_LEN
-+              SA_LEN((struct sockaddr *)&conn->remote_addr),
-+#else
-+              conn->remote_addr.ss_len,
-+#endif
-+              hostnamebuf, sizeof(hostnamebuf), NULL, 0, 0)) {
-+          conn->remote_host = ap_pstrdup(conn->pool, (void *)hostnamebuf);
-           ap_str_tolower(conn->remote_host);
-          
-           if (hostname_lookups == HOSTNAME_LOOKUP_DOUBLE) {
-@@ -776,6 +806,7 @@
- {
-     conn_rec *conn = r->connection;
-     core_dir_config *d;
-+    char hbuf[MAXHOSTNAMELEN];
-     d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
-                                               &core_module);
-@@ -785,23 +816,22 @@
-     }
-     if (d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
-         if (conn->local_host == NULL) {
--          struct in_addr *iaddr;
--          struct hostent *hptr;
-             int old_stat;
-           old_stat = ap_update_child_status(conn->child_num,
-                                             SERVER_BUSY_DNS, r);
--          iaddr = &(conn->local_addr.sin_addr);
--          hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr),
--                               AF_INET);
--          if (hptr != NULL) {
--              conn->local_host = ap_pstrdup(conn->pool,
--                                            (void *)hptr->h_name);
--              ap_str_tolower(conn->local_host);
--          }
--          else {
--              conn->local_host = ap_pstrdup(conn->pool,
--                                            r->server->server_hostname);
-+          if (getnameinfo((struct sockaddr *)&conn->local_addr,
-+#ifndef SIN6_LEN
-+                  SA_LEN((struct sockaddr *)&conn->local_addr),
-+#else
-+                  conn->local_addr.ss_len,
-+#endif
-+                  hbuf, sizeof(hbuf), NULL, 0, 0) == 0) {
-+              conn->local_host = ap_pstrdup(conn->pool, hbuf);
-+          } else {
-+              conn->local_host = ap_pstrdup(conn->pool,
-+                  r->server->server_hostname);
-           }
-+          ap_str_tolower(conn->local_host);
-           (void) ap_update_child_status(conn->child_num, old_stat, r);
-       }
-       return conn->local_host;
-@@ -820,11 +850,13 @@
-     if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
-       || d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
--        return r->hostname ? ntohs(r->connection->local_addr.sin_port)
--                         : port;
--    }
--    /* default */
--    return port;
-+        return r->hostname
-+          ?  ntohs(((struct sockaddr_in *)&r->connection->local_addr)->sin_port)
-+          : port;
-+    }
-+    return r->hostname
-+      ? ntohs(((struct sockaddr_in *)&r->connection->local_addr)->sin_port)
-+      : port;
- }
- API_EXPORT(char *) ap_construct_url(pool *p, const char *uri,
-@@ -2556,12 +2588,25 @@
- static const char *set_bind_address(cmd_parms *cmd, void *dummy, char *arg) 
- {
-+    struct addrinfo hints, *res;
-+    struct sockaddr *sa;
-+    size_t sa_len;
-+    int error;
-     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-     if (err != NULL) {
-         return err;
-     }
--    ap_bind_address.s_addr = ap_get_virthost_addr(arg, NULL);
-+    if (strcmp(arg, "*") == 0)
-+      arg = NULL;
-+
-+    sa = ap_get_virthost_addr(arg, NULL);
-+#ifdef HAVE_SOCKADDR_LEN
-+    sa_len = sa->sa_len;
-+#else
-+    sa_len = SA_LEN(sa);
-+#endif
-+    memcpy(&ap_bind_address, &sa, sa_len);
-     return NULL;
- }
-@@ -2593,44 +2638,70 @@
-     return NULL;
- }
--static const char *set_listener(cmd_parms *cmd, void *dummy, char *ips)
-+static const char *set_listener(cmd_parms *cmd, void *dummy, char *h, char *p)
- {
-     listen_rec *new;
--    char *ports;
--    unsigned short port;
-+    char *host, *port;
-+    struct addrinfo hints, *res;
-+    int error;
-     
-     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-     if (err != NULL) {
-         return err;
-     }
--    ports = strchr(ips, ':');
--    if (ports != NULL) {
--      if (ports == ips) {
--          return "Missing IP address";
--      }
--      else if (ports[1] == '\0') {
--          return "Address must end in :<port-number>";
-+    host = port = NULL;
-+    if (!p) {
-+      port = strrchr(h, ':');
-+      if (port != NULL) {
-+          if (port == h) {
-+              return "Missing IP address";
-+          }
-+          else if (port[1] == '\0') {
-+              return "Address must end in :<port-number>";
-+          }
-+          *(port++) = '\0';
-+          if (*h)
-+              host = h;
-+      } else {
-+          host = NULL;
-+          port = h;
-       }
--      *(ports++) = '\0';
--    }
--    else {
--      ports = ips;
-+    } else {
-+      host = h;
-+      port = p;
-     }
--    new=ap_pcalloc(cmd->pool, sizeof(listen_rec));
--    new->local_addr.sin_family = AF_INET;
--    if (ports == ips) { /* no address */
--      new->local_addr.sin_addr.s_addr = htonl(INADDR_ANY);
--    }
--    else {
--      new->local_addr.sin_addr.s_addr = ap_get_virthost_addr(ips, NULL);
--    }
--    port = atoi(ports);
--    if (!port) {
--      return "Port must be numeric";
-+    if (host && strcmp(host, "*") == 0)
-+      host = NULL;
-+    
-+    new = ap_pcalloc(cmd->pool, sizeof(listen_rec));
-+
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = host ? PF_UNSPEC : ap_default_family;
-+    hints.ai_flags = AI_PASSIVE;
-+    hints.ai_socktype = SOCK_STREAM;
-+    error = getaddrinfo(host, port, &hints, &res);
-+    if (error || !res) {
-+      fprintf(stderr, "could not resolve ");
-+      if (host)
-+          fprintf(stderr, "host \"%s\" ", host);
-+      if (port)
-+          fprintf(stderr, "port \"%s\" ", port);
-+      fprintf(stderr, "--- %s\n", gai_strerror(error));
-+      exit(1);
-+    }
-+    if (res->ai_next) {
-+        if (host)
-+          fprintf(stderr, "host \"%s\" ", host);
-+      if (port)
-+          fprintf(stderr, "port \"%s\" ", port);
-+      fprintf(stderr, "resolved to multiple addresses, ambiguous.\n");
-+      exit(1);
-     }
--    new->local_addr.sin_port = htons(port);
-+
-+    memcpy(&new->local_addr, res->ai_addr, res->ai_addrlen);
-+
-     new->fd = -1;
-     new->used = 0;
-     new->next = ap_listeners;
-@@ -3353,7 +3424,7 @@
- { "ThreadStackSize", set_threadstacksize, NULL, RSRC_CONF, TAKE1,
-   "Stack size each created thread will use."},
- #endif
--{ "Listen", set_listener, NULL, RSRC_CONF, TAKE1,
-+{ "Listen", set_listener, NULL, RSRC_CONF, TAKE12,
-   "A port number or a numeric IP address and a port number"},
- { "SendBufferSize", set_send_buffer_size, NULL, RSRC_CONF, TAKE1,
-   "Send buffer size in bytes"},
-@@ -3387,7 +3458,7 @@
-   "Name of the config file to be included" },
- { "LogLevel", set_loglevel, NULL, RSRC_CONF, TAKE1,
-   "Level of verbosity in error logging" },
--{ "NameVirtualHost", ap_set_name_virtual_host, NULL, RSRC_CONF, TAKE1,
-+{ "NameVirtualHost", ap_set_name_virtual_host, NULL, RSRC_CONF, TAKE12,
-   "A numeric IP address:port, or the name of a host" },
- #ifdef _OSD_POSIX
- { "BS2000Account", set_bs2000_account, NULL, RSRC_CONF, TAKE1,
-diff -Nur apache_1.3.26.orig/src/main/http_main.c apache_1.3.26/src/main/http_main.c
---- apache_1.3.26.orig/src/main/http_main.c    Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/main/http_main.c Wed Jun 19 10:30:52 2002
-@@ -124,6 +124,8 @@
- #include <bstring.h>          /* for IRIX, FD_SET calls bzero() */
- #endif
-+#include "sa_len.h"
-+
- #ifdef MULTITHREAD
- /* special debug stuff -- PCS */
-@@ -249,7 +251,12 @@
- API_VAR_EXPORT char *ap_scoreboard_fname=NULL;
- API_VAR_EXPORT char *ap_lock_fname=NULL;
- API_VAR_EXPORT char *ap_server_argv0=NULL;
--API_VAR_EXPORT struct in_addr ap_bind_address={0};
-+#ifdef INET6
-+API_VAR_EXPORT int ap_default_family = PF_INET6;
-+#else
-+API_VAR_EXPORT int ap_default_family = PF_INET;
-+#endif
-+API_VAR_EXPORT struct sockaddr_storage ap_bind_address={0};
- API_VAR_EXPORT int ap_daemons_to_start=0;
- API_VAR_EXPORT int ap_daemons_min_free=0;
- API_VAR_EXPORT int ap_daemons_max_free=0;
-@@ -1389,7 +1396,11 @@
-     fprintf(stderr, "Usage: %s [-D name] [-d directory] [-f file]\n", bin);
- #endif
-     fprintf(stderr, "       %s [-C \"directive\"] [-c \"directive\"]\n", pad);
--    fprintf(stderr, "       %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]\n", pad);
-+    fprintf(stderr, "       %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]"
-+#ifdef INET6
-+          " [-46]"
-+#endif
-+          "\n", pad);
-     fprintf(stderr, "Options:\n");
- #ifdef SHARED_CORE
-     fprintf(stderr, "  -R directory     : specify an alternate location for shared object files\n");
-@@ -1415,6 +1426,10 @@
- #ifndef WIN32
-     fprintf(stderr, "  -F               : run main process in foreground, for process supervisors\n");
- #endif
-+#ifdef INET6
-+    fprintf(stderr, "  -4               : assume IPv4 on parsing configuration file\n");
-+    fprintf(stderr, "  -6               : assume IPv6 on parsing configuration file\n");
-+#endif
- #ifdef WIN32
-     fprintf(stderr, "  -n name          : name the Apache service for -k options below;\n");
-     fprintf(stderr, "  -k stop|shutdown : tell running Apache to shutdown\n");
-@@ -3592,11 +3607,13 @@
- static conn_rec *new_connection(pool *p, server_rec *server, BUFF *inout,
--                           const struct sockaddr_in *remaddr,
--                           const struct sockaddr_in *saddr,
-+                           const struct sockaddr *remaddr,
-+                           const struct sockaddr *saddr,
-                            int child_num)
- {
-     conn_rec *conn = (conn_rec *) ap_pcalloc(p, sizeof(conn_rec));
-+    char hostnamebuf[MAXHOSTNAMELEN];
-+    size_t addr_len;
-     /* Got a connection structure, so initialize what fields we can
-      * (the rest are zeroed out by pcalloc).
-@@ -3605,17 +3622,29 @@
-     conn->child_num = child_num;
-     conn->pool = p;
--    conn->local_addr = *saddr;
--    conn->local_ip = ap_pstrdup(conn->pool,
--                              inet_ntoa(conn->local_addr.sin_addr));
-+#ifndef SIN6_LEN
-+    addr_len = SA_LEN(saddr);
-+#else 
-+    addr_len = saddr->sa_len;
-+#endif
-+    memcpy(&conn->local_addr, saddr, addr_len); 
-+    getnameinfo((struct sockaddr *)&conn->local_addr, addr_len,
-+           hostnamebuf, sizeof(hostnamebuf), NULL, 0, NI_NUMERICHOST);  
-+    conn->local_ip = ap_pstrdup(conn->pool, hostnamebuf);
-     conn->server = server; /* just a guess for now */
-     ap_update_vhost_given_ip(conn);
-     conn->base_server = conn->server;
-     conn->client = inout;
--    conn->remote_addr = *remaddr;
--    conn->remote_ip = ap_pstrdup(conn->pool,
--                            inet_ntoa(conn->remote_addr.sin_addr));
-+#ifndef SIN6_LEN 
-+    addr_len = SA_LEN(remaddr);
-+#else 
-+    addr_len = remaddr->sa_len;
-+#endif
-+    memcpy(&conn->remote_addr, remaddr, addr_len);
-+    getnameinfo((struct sockaddr *)&conn->remote_addr, addr_len,
-+          hostnamebuf, sizeof(hostnamebuf), NULL, 0, NI_NUMERICHOST);
-+    conn->remote_ip = ap_pstrdup(conn->pool, hostnamebuf);           
- #ifdef EAPI
-     conn->ctx = ap_ctx_new(conn->pool);
- #endif /* EAPI */
-@@ -3666,21 +3695,47 @@
- #define sock_disable_nagle(s) /* NOOP */
- #endif
--static int make_sock(pool *p, const struct sockaddr_in *server)
-+static int make_sock(pool *p, const struct sockaddr *server)
- {
-     int s;
-     int one = 1;
--    char addr[512];
-+    char addr[INET6_ADDRSTRLEN + 128];
-+    char a0[INET6_ADDRSTRLEN];
-+    char p0[NI_MAXSERV];
-+#ifdef MPE
-+    int privport = 0;
-+#endif
--    if (server->sin_addr.s_addr != htonl(INADDR_ANY))
--      ap_snprintf(addr, sizeof(addr), "address %s port %d",
--              inet_ntoa(server->sin_addr), ntohs(server->sin_port));
--    else
--      ap_snprintf(addr, sizeof(addr), "port %d", ntohs(server->sin_port));
-+    switch(server->sa_family){
-+    case AF_INET:
-+#ifdef INET6
-+    case AF_INET6:
-+#endif
-+      break;
-+    default:
-+      ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
-+                   "make_sock: unsupported address family %u", 
-+                 server->sa_family);
-+      ap_unblock_alarms();
-+      exit(1);
-+    }
-+    
-+    getnameinfo(server,
-+#ifndef SIN6_LEN
-+              SA_LEN(server),
-+#else
-+              server->sa_len,
-+#endif
-+              a0, sizeof(a0), p0, sizeof(p0), NI_NUMERICHOST | NI_NUMERICSERV);
-+    ap_snprintf(addr, sizeof(addr), "address %s port %s", a0, p0);
-+#ifdef MPE
-+    if (atoi(p0) < 1024)
-+      privport++;
-+#endif
-     /* note that because we're about to slack we don't use psocket */
-     ap_block_alarms();
--    if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
-+    if ((s = socket(server->sa_family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
-           ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
-                   "make_sock: failed to get a socket for %s", addr);
-@@ -3783,15 +3838,19 @@
- #ifdef MPE
- /* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */
--    if (ntohs(server->sin_port) < 1024)
-+    if (privport)
-       GETPRIVMODE();
- #endif
--
--    if (bind(s, (struct sockaddr *) server, sizeof(struct sockaddr_in)) == -1) {
-+#ifndef SIN6_LEN
-+    if (bind(s, server, SA_LEN(server)) == -1)
-+#else
-+    if (bind(s, server, server->sa_len) == -1)
-+#endif
-+    {
-       ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
-           "make_sock: could not bind to %s", addr);
- #ifdef MPE
--      if (ntohs(server->sin_port) < 1024)
-+      if (privport)
-           GETUSERMODE();
- #endif
-@@ -3804,7 +3863,7 @@
-       exit(1);
-     }
- #ifdef MPE
--    if (ntohs(server->sin_port) < 1024)
-+    if (privport)
-       GETUSERMODE();
- #endif
-@@ -3957,15 +4016,17 @@
-     for (;;) {
-       fd = find_listener(lr);
-       if (fd < 0) {
--          fd = make_sock(p, &lr->local_addr);
-+          fd = make_sock(p, (struct sockaddr *)&lr->local_addr);
-       }
-       else {
-           ap_note_cleanups_for_socket(p, fd);
-       }
-       /* if we get here, (fd >= 0) && (fd < FD_SETSIZE) */
--      FD_SET(fd, &listenfds);
--      if (fd > listenmaxfd)
--          listenmaxfd = fd;
-+      if (fd > 0) {
-+          FD_SET(fd, &listenfds);
-+          if (fd > listenmaxfd)
-+              listenmaxfd = fd;
-+      }
-       lr->fd = fd;
-       if (lr->next == NULL)
-           break;
-@@ -4280,8 +4341,8 @@
- static void child_main(int child_num_arg)
- {
-     NET_SIZE_T clen;
--    struct sockaddr sa_server;
--    struct sockaddr sa_client;
-+    struct sockaddr_storage sa_server;
-+    struct sockaddr_storage sa_client;
-     listen_rec *lr;
-     /* All of initialization is a critical section, we don't care if we're
-@@ -4453,7 +4514,7 @@
-           usr1_just_die = 0;
-           for (;;) {
-               clen = sizeof(sa_client);
--              csd = ap_accept(sd, &sa_client, &clen);
-+              csd = ap_accept(sd, (struct sockaddr *)&sa_client, &clen);
-               if (csd >= 0 || errno != EINTR)
-                   break;
-               if (deferred_die) {
-@@ -4616,7 +4677,7 @@
-        */
-       clen = sizeof(sa_server);
--      if (getsockname(csd, &sa_server, &clen) < 0) {
-+      if (getsockname(csd, (struct sockaddr *)&sa_server, &clen) < 0) {
-           ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname");
-           continue;
-       }
-@@ -4661,8 +4722,8 @@
-       ap_bpushfd(conn_io, csd, dupped_csd);
-       current_conn = new_connection(ptrans, server_conf, conn_io,
--                                        (struct sockaddr_in *) &sa_client,
--                                        (struct sockaddr_in *) &sa_server,
-+                                        (struct sockaddr *)&sa_client,
-+                                        (struct sockaddr *)&sa_server,
-                                         my_child_num);
-       /*
-@@ -4817,12 +4878,13 @@
- #ifdef _OSD_POSIX
-     /* BS2000 requires a "special" version of fork() before a setuid() call */
--    if ((pid = os_fork(ap_user_name)) == -1) {
-+    if ((pid = os_fork(ap_user_name)) == -1)
- #elif defined(TPF)
--    if ((pid = os_fork(s, slot)) == -1) {
-+    if ((pid = os_fork(s, slot)) == -1)
- #else
--    if ((pid = fork()) == -1) {
-+    if ((pid = fork()) == -1)
- #endif
-+    {
-       ap_log_error(APLOG_MARK, APLOG_ERR, s, "fork: Unable to fork new process");
-       /* fork didn't succeed. Fix the scoreboard or else
-@@ -5434,7 +5496,10 @@
-     ap_setup_prelinked_modules();
-     while ((c = getopt(argc, argv,
--                                  "D:C:c:xXd:Ff:vVlLR:StTh"
-+                                  "D:C:c:xXd:Ff:vVlLR:StTh4"
-+#ifdef INET6
-+                                  "6"
-+#endif
- #ifdef DEBUG_SIGSTOP
-                                   "Z:"
- #endif
-@@ -5512,8 +5577,14 @@
-           ap_configtestonly = 1;
-           ap_docrootcheck = 0;
-           break;
--      case 'h':
--          usage(argv[0]);
-+      case '4':
-+          ap_default_family = PF_INET;
-+          break;
-+#ifdef INET6
-+      case '6':
-+          ap_default_family = PF_INET6;
-+          break;
-+#endif
-       case '?':
-           usage(argv[0]);
-       }
-@@ -5601,9 +5672,10 @@
-     else {
-       conn_rec *conn;
-       request_rec *r;
--      struct sockaddr sa_server, sa_client;
-       BUFF *cio;
-+      struct sockaddr_storage sa_server, sa_client;
-       NET_SIZE_T l;
-+      char servbuf[NI_MAXSERV];
-       ap_set_version();
-       /* Yes this is called twice. */
-@@ -5658,25 +5730,32 @@
- #endif
-       l = sizeof(sa_client);
--      if ((getpeername(sock_in, &sa_client, &l)) < 0) {
-+      if ((getpeername(sock_in, (struct sockaddr *)&sa_client, &l)) < 0) {
- /* get peername will fail if the input isn't a socket */
-           perror("getpeername");
-           memset(&sa_client, '\0', sizeof(sa_client));
-       }
-       l = sizeof(sa_server);
--      if (getsockname(sock_in, &sa_server, &l) < 0) {
-+      if (getsockname(sock_in, (struct sockaddr *)&sa_server, &l) < 0) {
-           perror("getsockname");
-           fprintf(stderr, "Error getting local address\n");
-           exit(1);
-       }
--      server_conf->port = ntohs(((struct sockaddr_in *) &sa_server)->sin_port);
-+      if (getnameinfo(((struct sockaddr *)&sa_server), l,
-+                      NULL, 0, servbuf, sizeof(servbuf), 
-+                      NI_NUMERICSERV)){
-+          fprintf(stderr, "getnameinfo(): family=%d\n", sa_server.ss_family);
-+          exit(1);
-+      }
-+      servbuf[sizeof(servbuf)-1] = '\0';
-+      server_conf->port = atoi(servbuf);
-       cio = ap_bcreate(ptrans, B_RDWR | B_SOCKET);
-         cio->fd = sock_out;
-         cio->fd_in = sock_in;
-       conn = new_connection(ptrans, server_conf, cio,
--                                (struct sockaddr_in *) &sa_client,
--                                (struct sockaddr_in *) &sa_server, -1);
-+                                (struct sockaddr *)&sa_client,
-+                                (struct sockaddr *)&sa_server, -1);
-       while ((r = ap_read_request(conn)) != NULL) {
-@@ -7383,7 +7462,11 @@
-     while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLz:Z:wiuStThk:n:W:")) != -1) {
- #else /* !WIN32 */
--    while ((c = getopt(argc, argv, "D:C:c:Xd:Ff:vVlLesStTh")) != -1) {
-+    while ((c = getopt(argc, argv, "D:C:c:Xd:Ff:vVlLesStTh4"
-+#ifdef INET6
-+              "6"
-+#endif
-+              )) != -1) {
- #endif
-         char **new;
-       switch (c) {
-@@ -7929,6 +8012,10 @@
-       case 't':
-       case 'T':
-       case 'h':
-+      case '4':
-+#ifdef INET6
-+      case '6':
-+#endif
-       case '?':
-           break;
-       case 'R':
-diff -Nur apache_1.3.26.orig/src/main/http_vhost.c apache_1.3.26/src/main/http_vhost.c
---- apache_1.3.26.orig/src/main/http_vhost.c   Wed Mar 13 22:05:31 2002
-+++ apache_1.3.26/src/main/http_vhost.c        Wed Jun 19 10:26:32 2002
-@@ -68,6 +68,7 @@
- #include "http_log.h"
- #include "http_vhost.h"
- #include "http_protocol.h"
-+#include "sa_len.h"
- /*
-  * After all the definitions there's an explanation of how it's all put
-@@ -165,78 +166,114 @@
-  * *paddr is the variable used to keep track of **paddr between calls
-  * port is the default port to assume
-  */
--static const char *get_addresses(pool *p, char *w, server_addr_rec ***paddr,
--                          unsigned port)
-+static const char *get_addresses(pool *p, char *w, char *pstr,
-+      server_addr_rec ***paddr, unsigned port)
- {
--    struct hostent *hep;
--    unsigned long my_addr;
-+    struct addrinfo hints, *res, *res0;
-     server_addr_rec *sar;
--    char *t;
--    int i, is_an_ip_addr;
-+    char *t = NULL, *u = NULL, *v = NULL;
-+    char *hoststr = NULL, *portstr = NULL;
-+    char portpool[10];
-+    int error;
-+    char servbuf[NI_MAXSERV];
--    if (*w == 0)
-+    if (w == 0 || *w == 0)
-       return NULL;
--    t = strchr(w, ':');
--    if (t) {
--      if (strcmp(t + 1, "*") == 0) {
--          port = 0;
-+    portstr = portpool;
-+    ap_snprintf(portpool, sizeof(portpool), "%u", port);
-+    if (!pstr) {
-+      v = w;
-+      u = NULL;
-+      if (*w == '['){
-+          u = strrchr(w, ']');
-+          if (u) {    /* [host]:port or [host] */
-+              w++;
-+              *u = '\0';
-+              v = u + 1;
-+          }
-       }
--      else if ((i = atoi(t + 1))) {
--          port = i;
-+      /*        w   uv     ,       w=v        , w=v  */  
-+      /* u!=0: [host]:port , u==0: [host:port , host */
-+      t = strchr(v, ':');
-+      if (t != NULL && strchr(t+1, ':') == NULL) {
-+          /* [host]:port-w/o-colons, host-without-colons:port-w/o-colons */
-+          *t = '\0';
-+          portstr = t + 1;
-       }
-       else {
--          return ":port must be numeric";
-+          portstr = "0";
-       }
--      *t = 0;
-+    } else {
-+      portstr = pstr;
-     }
--    is_an_ip_addr = 0;
--    if (strcmp(w, "*") == 0) {
--      my_addr = htonl(INADDR_ANY);
--      is_an_ip_addr = 1;
--    }
--    else if (strcasecmp(w, "_default_") == 0
--           || strcmp(w, "255.255.255.255") == 0) {
--      my_addr = DEFAULT_VHOST_ADDR;
--      is_an_ip_addr = 1;
--    }
--    else if ((my_addr = ap_inet_addr(w)) != INADDR_NONE) {
--      is_an_ip_addr = 1;
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_socktype = SOCK_STREAM;
-+    if (strcmp(w, "*") == 0 || strlen(w) == 0) {
-+      hoststr = NULL;
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_flags = AI_PASSIVE;
-+    }
-+    else if (strcasecmp(w, "_default4_") == 0 ||
-+           ((ap_default_family == PF_INET
-+#ifndef INET6
-+             || ap_default_family == PF_UNSPEC
-+#endif
-+             ) && strcasecmp(w, "_default_") == 0)){
-+      hoststr = "255.255.255.255";
-+      hints.ai_family = PF_INET;
-+    }
-+#ifdef INET6
-+    else if (strcasecmp(w, "_default6_") == 0 ||
-+           ((ap_default_family == PF_INET6
-+             || ap_default_family == PF_UNSPEC
-+             ) && strcasecmp(w, "_default_") == 0)){
-+      hoststr = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff";
-+      hints.ai_family = PF_INET6;
-     }
--    if (is_an_ip_addr) {
--      sar = ap_pcalloc(p, sizeof(server_addr_rec));
--      **paddr = sar;
--      *paddr = &sar->next;
--      sar->host_addr.s_addr = my_addr;
--      sar->host_port = port;
--      sar->virthost = ap_pstrdup(p, w);
--      if (t != NULL)
--          *t = ':';
--      return NULL;
-+#endif
-+    else{
-+      hoststr = w;
-+      hints.ai_family = PF_UNSPEC;
-     }
--    hep = gethostbyname(w);
--
--    if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
-+    error = getaddrinfo(hoststr, portstr, &hints, &res0);
-+    if (error || !res0) {
-       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
--          "Cannot resolve host name %s --- ignoring!", w);
--      if (t != NULL)
--          *t = ':';
-+          "Cannot resolve host %s port %s --- ignoring!", hoststr, portstr);
-+      if (t != NULL) *t = ':';
-+      if (u != NULL) *u = ']';
-       return NULL;
-     }
--
--    for (i = 0; hep->h_addr_list[i]; ++i) {
-+    for (res=res0; res; res=res->ai_next) {
-+      switch (res->ai_addr->sa_family) {
-+      case AF_INET:
-+#ifdef INET6
-+      case AF_INET6:
-+#endif
-+          break;
-+      default:
-+          ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
-+                       "Unsupported address family %u, for host %s port %s --- ignoring!",
-+                       res->ai_addr->sa_family, hoststr, portstr);
-+          continue;
-+      }
-       sar = ap_pcalloc(p, sizeof(server_addr_rec));
-       **paddr = sar;
-       *paddr = &sar->next;
--      sar->host_addr = *(struct in_addr *) hep->h_addr_list[i];
--      sar->host_port = port;
-+      memcpy(&sar->host_addr, res->ai_addr, res->ai_addrlen);
-+      if (getnameinfo(res->ai_addr, res->ai_addrlen, NULL, 0, servbuf,
-+                      sizeof(servbuf), NI_NUMERICSERV) == 0)
-+              sar->host_port = atoi(servbuf);
-+      else
-+              sar->host_port = 0;
-       sar->virthost = ap_pstrdup(p, w);
-     }
--    if (t != NULL)
--      *t = ':';
-+    freeaddrinfo(res0);
-+    if (t != NULL) *t = ':';
-+    if (u != NULL) *u = ']';
-     return NULL;
- }
-@@ -250,7 +287,8 @@
-     /* start the list of addreses */
-     addrs = &s->addrs;
-     while (hostname[0]) {
--      err = get_addresses(p, ap_getword_conf(p, &hostname), &addrs, s->port);
-+      err = get_addresses(p, ap_getword_conf(p, &hostname), NULL,
-+              &addrs, s->port);
-       if (err) {
-           *addrs = NULL;
-           return err;
-@@ -268,10 +306,11 @@
- }
--API_EXPORT_NONSTD(const char *) ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg)
-+API_EXPORT_NONSTD(const char *) ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *h, 
-+      char *p)
- {
-     /* use whatever port the main server has at this point */
--    return get_addresses(cmd->pool, arg, &name_vhost_list_tail,
-+    return get_addresses(cmd->pool, h, p, &name_vhost_list_tail,
-                           cmd->server->port);
- }
-@@ -345,6 +384,19 @@
-     return ((key >> 8) ^ key) % IPHASH_TABLE_SIZE;
- }
-+static unsigned hash_addr(struct sockaddr *sa)
-+{
-+    switch (sa->sa_family) {
-+    case AF_INET:
-+      return hash_inaddr(((struct sockaddr_in *)sa)->sin_addr.s_addr);
-+#ifdef INET6
-+    case AF_INET6:
-+      return hash_inaddr(((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[12]);
-+#endif
-+    default:
-+      return hash_inaddr(sa->sa_family);
-+    }
-+}
- static ipaddr_chain *new_ipaddr_chain(pool *p,
-@@ -372,25 +424,77 @@
-     return new;
- }
--
--static ap_inline ipaddr_chain *find_ipaddr(struct in_addr *server_ip,
--    unsigned port)
-+static ap_inline ipaddr_chain *find_ipaddr(struct sockaddr *sa)
- {
-     unsigned bucket;
-     ipaddr_chain *trav;
--    unsigned addr;
-+    char a[NI_MAXHOST], b[NI_MAXHOST];
-     /* scan the hash table for an exact match first */
--    addr = server_ip->s_addr;
--    bucket = hash_inaddr(addr);
-+    bucket = hash_addr(sa);
-     for (trav = iphash_table[bucket]; trav; trav = trav->next) {
-       server_addr_rec *sar = trav->sar;
--      if ((sar->host_addr.s_addr == addr)
--          && (sar->host_port == 0 || sar->host_port == port
--              || port == 0)) {
--          return trav;
-+      if (sar->host_addr.ss_family != sa->sa_family)
-+          continue;
-+      switch (sa->sa_family) {
-+      case AF_INET:
-+        {
-+          struct sockaddr_in *sin1, *sin2;
-+          sin1 = (struct sockaddr_in *)&sar->host_addr;
-+          sin2 = (struct sockaddr_in *)sa;
-+          if (sin1->sin_port == 0 || sin2->sin_port == 0
-+           || sin1->sin_port == sin2->sin_port) {
-+              if (memcmp(&sin1->sin_addr, &sin2->sin_addr,
-+                      sizeof(sin1->sin_addr)) == 0) {
-+                  return trav;
-+              }
-+          }
-+          break;
-+        }
-+#ifdef INET6
-+      case AF_INET6:
-+        {
-+          struct sockaddr_in6 *sin1, *sin2;
-+          sin1 = (struct sockaddr_in6 *)&sar->host_addr;
-+          sin2 = (struct sockaddr_in6 *)sa;
-+          if (sin1->sin6_port == 0 || sin2->sin6_port == 0
-+           || sin1->sin6_port == sin2->sin6_port) {
-+              if (memcmp(&sin1->sin6_addr, &sin2->sin6_addr,
-+                      sizeof(sin1->sin6_addr)) == 0) {
-+                  return trav;
-+              }
-+          }
-+          break;
-+        }
-+#endif
-+      default: /*unsupported*/
-+          break;
-       }
-     }
-+
-+#ifdef INET6
-+    if (sa->sa_family == AF_INET6 &&
-+      IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)sa)->sin6_addr)) {
-+      /*
-+       * This is just horrible.  I just hate IPv4 mapped address.  It
-+       * complicates access control too much.
-+       * Due to hashed lookup, we need to visit it again.
-+       */
-+      struct sockaddr_in sin;
-+
-+      memset(&sin, 0, sizeof(sin));
-+      sin.sin_family = AF_INET;
-+#ifdef SIN6_LEN
-+      sin.sin_len = sizeof(sin);
-+#endif
-+      sin.sin_port = ((struct sockaddr_in6 *)sa)->sin6_port;
-+      memcpy(&sin.sin_addr,
-+          &((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[12],
-+          sizeof(sin.sin_addr));
-+      return find_ipaddr((struct sockaddr *)&sin);
-+    }
-+#endif
-+
-     return NULL;
- }
-@@ -416,21 +520,7 @@
-     int len;
-     char buf[MAX_STRING_LEN];
--    if (ic->sar->host_addr.s_addr == DEFAULT_VHOST_ADDR) {
--      len = ap_snprintf(buf, sizeof(buf), "_default_:%u",
--              ic->sar->host_port);
--    }
--    else if (ic->sar->host_addr.s_addr == INADDR_ANY) {
--      len = ap_snprintf(buf, sizeof(buf), "*:%u",
--              ic->sar->host_port);
--    }
--    else {
--      len = ap_snprintf(buf, sizeof(buf), "%pA:%u",
--              &ic->sar->host_addr, ic->sar->host_port);
--    }
--    if (ic->sar->host_port == 0) {
--      buf[len-1] = '*';
--    }
-+    len = ap_snprintf(buf, sizeof(buf), "%pI", &ic->sar->host_addr);
-     if (ic->names == NULL) {
-       if (ic->server == NULL)
-           fprintf(f, "%-22s WARNING: No <VirtualHost> defined for this NameVirtualHost!\n", buf);
-@@ -558,10 +648,37 @@
-      * occured in the config file, we'll copy it in that order.
-      */
-     for (sar = name_vhost_list; sar; sar = sar->next) {
--      unsigned bucket = hash_inaddr(sar->host_addr.s_addr);
-+      unsigned bucket = hash_addr((struct sockaddr *)&sar->host_addr);
-       ipaddr_chain *ic = new_ipaddr_chain(p, NULL, sar);
-+      int wildcard;
-+
-+      wildcard = 0;
-+      switch (sar->host_addr.ss_family) {
-+      case AF_INET:
-+        {
-+          struct sockaddr_in *sin;
-+          sin = (struct sockaddr_in *)&sar->host_addr;
-+          if (sin->sin_addr.s_addr == INADDR_ANY)
-+              wildcard++;
-+          break;
-+        }
-+#ifdef INET6
-+      case AF_INET6:
-+        {
-+          struct sockaddr_in6 *sin6;
-+          sin6 = (struct sockaddr_in6 *)&sar->host_addr;
-+          if (*(ap_uint32_t *)&sin6->sin6_addr.s6_addr[0] == 0
-+           && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[4] == 0
-+           && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[8] == 0
-+           && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[12] == 0) {
-+              wildcard++;
-+          }
-+          break;
-+        }
-+#endif
-+      }
--      if (sar->host_addr.s_addr != INADDR_ANY) {
-+      if (!wildcard) {
-           *iphash_table_tail[bucket] = ic;
-           iphash_table_tail[bucket] = &ic->next;
-       }
-@@ -588,12 +705,45 @@
-       has_default_vhost_addr = 0;
-       for (sar = s->addrs; sar; sar = sar->next) {
-           ipaddr_chain *ic;
-+          int wildcard;
-+
-+          wildcard = 0;
-+          switch (sar->host_addr.ss_family) {
-+          case AF_INET:
-+            {
-+              struct sockaddr_in *sin;
-+              sin = (struct sockaddr_in *)&sar->host_addr;
-+              if (sin->sin_addr.s_addr == DEFAULT_VHOST_ADDR)
-+                  wildcard++;
-+              else if (sin->sin_addr.s_addr == INADDR_ANY)
-+                  wildcard++;
-+              break;
-+            }
-+#ifdef INET6
-+          case AF_INET6:
-+            {
-+              struct sockaddr_in6 *sin6;
-+              sin6 = (struct sockaddr_in6 *)&sar->host_addr;
-+              if (*(ap_uint32_t *)&sin6->sin6_addr.s6_addr[0] == ~0
-+               && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[4] == ~0
-+               && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[8] == ~0
-+               && *(ap_uint32_t *)&sin6->sin6_addr.s6_addr[12] == ~0) {
-+                  wildcard++;
-+              }
-+              break;
-+            }
-+#endif
-+          }
--          if (sar->host_addr.s_addr == DEFAULT_VHOST_ADDR
--              || sar->host_addr.s_addr == INADDR_ANY) {
--              ic = find_default_server(sar->host_port);
--              if (!ic || !add_name_vhost_config(p, main_s, s, sar, ic)) {
--                  if (ic && ic->sar->host_port != 0) {
-+          if (wildcard) {
-+              /* add it to default bucket for each appropriate sar
-+               * since we need to do a port test
-+               */
-+              ipaddr_chain *other;
-+
-+              other = find_default_server(sar->host_port);
-+              if (!other || !add_name_vhost_config(p, main_s, s, sar, other)) {
-+                  if (other && other->sar->host_port != 0) {
-                       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
-                           main_s, "_default_ VirtualHost overlap on port %u,"
-                           " the first has precedence", sar->host_port);
-@@ -606,10 +756,11 @@
-           }
-           else {
-               /* see if it matches something we've already got */
--              ic = find_ipaddr(&sar->host_addr, sar->host_port);
-+              ic = find_ipaddr((struct sockaddr *)&sar->host_addr);
-               if (!ic) {
--                  unsigned bucket = hash_inaddr(sar->host_addr.s_addr);
-+                  unsigned bucket =
-+                      hash_addr((struct sockaddr *)&sar->host_addr);
-                   ic = new_ipaddr_chain(p, s, sar);
-                   ic->next = *iphash_table_tail[bucket];
-@@ -646,19 +797,33 @@
-           }
-           else {
-               struct hostent *h;
-+              char hostnamebuf[MAXHOSTNAMELEN];
--              if ((h = gethostbyaddr((char *) &(s->addrs->host_addr),
--                                      sizeof(struct in_addr), AF_INET))) {
--                  s->server_hostname = ap_pstrdup(p, (char *) h->h_name);
-+              if (!getnameinfo((struct sockaddr *)&s->addrs->host_addr,
-+#ifndef SIN6_LEN
-+                      SA_LEN((struct sockaddr *)&s->addrs->host_addr),
-+#else 
-+                      s->addrs->host_addr.ss_len,
-+#endif
-+                      hostnamebuf, sizeof(hostnamebuf),
-+                      NULL, 0, 0)) {
-+                  s->server_hostname = ap_pstrdup(p, hostnamebuf);
-               }
-               else {
-                   /* again, what can we do?  They didn't specify a
-                      ServerName, and their DNS isn't working. -djg */
-+                  getnameinfo((struct sockaddr *)&s->addrs->host_addr,
-+#ifndef SIN6_LEN
-+                      SA_LEN((struct sockaddr *)&s->addrs->host_addr),
-+#else 
-+                      s->addrs->host_addr.ss_len,
-+#endif
-+                      hostnamebuf, sizeof(hostnamebuf),
-+                      NULL, 0, NI_NUMERICHOST);
-                   ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, main_s,
-                           "Failed to resolve server name "
-                           "for %s (check DNS) -- or specify an explicit "
--                          "ServerName",
--                          inet_ntoa(s->addrs->host_addr));
-+                          "ServerName", hostnamebuf);
-                   s->server_hostname =
-                       ap_pstrdup(p, "bogus_host_without_reverse_dns");
-               }
-@@ -705,35 +870,58 @@
-     char *host = ap_palloc(r->pool, strlen(r->hostname) + 1);
-     const char *src;
-     char *dst;
-+    const char *u = NULL, *v = NULL;
-     /* check and copy the host part */
--    src = r->hostname;
-+    u = src = r->hostname;
-     dst = host;
--    while (*src) {
--      if (*src == '.') {
--          *dst++ = *src++;
--          if (*src == '.')
--              goto bad;
--          else
--              continue;
--      }
--      if (*src == '/' || *src == '\\') {
--          goto bad;
--      }
--        if (*src == ':') {
--            /* check the port part */
--            while (*++src) {
--                if (!ap_isdigit(*src)) {
--                    goto bad;
--                }
--            }
--            if (src[-1] == ':')
--                goto bad;
--            else
--                break;
-+     if (*u == '[') { /* IPv6 numeral address in brackets */
-+         v = strchr(u, ']');
-+       if (v == NULL) {
-+           /* missing closing bracket */
-+             goto bad;
-+       }
-+         if (v == (u + 1)) {
-+             /* bad empty address */
-+             goto bad;
-+       }
-+       for (src = u+1; src < v; src++)  /* copy IPv6 adress */
-+           *dst = *src;
-+       v++;
-+       if (*v == ':') {
-+          v++;
-+          while (*v) {  /* check if portnum is correct */
-+              if (!ap_isdigit(*v++))
-+                  goto bad;
-+          }
-         }
--      *dst++ = *src++;
-+     } else {
-+         while (*src) {
-+           if (*src == '.') {
-+               *dst++ = *src++;
-+               if (*src == '.')
-+                   goto bad;
-+               else
-+                   continue;
-+           }
-+           if (*src == '/' || *src == '\\') {
-+               goto bad;
-+           }
-+           if (*src == ':') {
-+               /* sheck the port part */
-+               while (*++src) {
-+                   if (!ap_isdigit(*src)) {
-+                       goto bad;
-+                   }
-+               }
-+               if (src[-1] == ':')
-+                   goto bad;
-+               else
-+                   break;
-+           }
-+           *dst++ = *src++;
-+         }
-     }
-     /* strip trailing gubbins */
-     if (dst > host && dst[-1] == '.') {
-@@ -748,7 +936,7 @@
- bad:
-     r->status = HTTP_BAD_REQUEST;
-     ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
--                "Client sent malformed Host header");
-+                "Client sent malformed Host header <<%s>>",u);
-     return;
- }
-@@ -851,11 +1039,25 @@
-      *   names we'll match have ports associated with them
-      */
-     const char *host = r->hostname;
--    unsigned port = ntohs(r->connection->local_addr.sin_port);
-+    unsigned port;
-     server_rec *s;
-     server_rec *last_s;
-     name_chain *src;
-+    switch (r->connection->local_addr.ss_family) {
-+    case AF_INET:
-+      port = ntohs(((struct sockaddr_in *)
-+                  &r->connection->local_addr)->sin_port);
-+      break;
-+#ifdef INET6
-+    case AF_INET6:
-+      port = ntohs(((struct sockaddr_in6 *)
-+                  &r->connection->local_addr)->sin6_port);
-+      break;
-+#endif
-+    default:
-+      port = 0;       /*XXX*/
-+    }
-     last_s = NULL;
-     /* Recall that the name_chain is a list of server_addr_recs, some of
-@@ -910,7 +1112,22 @@
-     server_rec *s;
-     server_rec *last_s;
-     name_chain *src;
--    unsigned port = ntohs(r->connection->local_addr.sin_port);
-+    unsigned port;
-+
-+    switch (r->connection->local_addr.ss_family) {
-+    case AF_INET:
-+      port = ntohs(((struct sockaddr_in *)
-+                  &r->connection->local_addr)->sin_port);
-+      break;
-+#ifdef INET6
-+    case AF_INET6:
-+      port = ntohs(((struct sockaddr_in6 *)
-+                  &r->connection->local_addr)->sin6_port);
-+      break;
-+#endif
-+    default:
-+      port = 0;       /*XXX*/
-+    }
-     /*
-      * This is in conjunction with the ServerPath code in http_core, so we
-@@ -970,10 +1187,22 @@
- API_EXPORT(void) ap_update_vhost_given_ip(conn_rec *conn)
- {
-     ipaddr_chain *trav;
--    unsigned port = ntohs(conn->local_addr.sin_port);
-+    char portbuf[NI_MAXSERV];
-+    unsigned port;
-+
-+    if (getnameinfo((struct sockaddr *)&conn->local_addr,
-+#ifndef SIN6_LEN
-+      SA_LEN((struct sockaddr *)&conn->local_addr),
-+#else 
-+      conn->local_addr.ss_len,
-+#endif
-+      NULL, 0, portbuf, sizeof(portbuf), NI_NUMERICSERV) != 0) {
-+      goto fail;
-+    }
-+    port = atoi(portbuf);
-     /* scan the hash table for an exact match first */
--    trav = find_ipaddr(&conn->local_addr.sin_addr, port);
-+    trav = find_ipaddr((struct sockaddr *)&conn->local_addr);
-     if (trav) {
-       /* save the name_chain for later in case this is a name-vhost */
-       conn->vhost_lookup_data = trav->names;
-@@ -991,6 +1220,7 @@
-       return;
-     }
-+fail:
-     /* otherwise we're stuck with just the main server
-      * and no name-based vhosts
-      */
-diff -Nur apache_1.3.26.orig/src/main/rfc1413.c apache_1.3.26/src/main/rfc1413.c
---- apache_1.3.26.orig/src/main/rfc1413.c      Wed Mar 13 22:05:31 2002
-+++ apache_1.3.26/src/main/rfc1413.c   Wed Jun 19 10:26:32 2002
-@@ -82,6 +82,7 @@
- #include "http_log.h"         /* for aplog_error */
- #include "rfc1413.h"
- #include "http_main.h"                /* set_callback_and_alarm */
-+#include "sa_len.h"
- /* Local stuff. */
- /* Semi-well-known port */
-@@ -109,12 +110,13 @@
- /* bind_connect - bind both ends of a socket */
- /* Ambarish fix this. Very broken */
--static int get_rfc1413(int sock, const struct sockaddr_in *our_sin,
--                     const struct sockaddr_in *rmt_sin, 
-+static int get_rfc1413(int sock, const struct sockaddr *our_sin,
-+                     const struct sockaddr *rmt_sin, 
-                      char user[RFC1413_USERLEN+1], server_rec *srv)
- {
--    struct sockaddr_in rmt_query_sin, our_query_sin;
--    unsigned int rmt_port, our_port;
-+    struct sockaddr_storage rmt_query_sin, our_query_sin;
-+    unsigned int o_rmt_port, o_our_port;      /* original port pair */
-+    unsigned int rmt_port, our_port;          /* replied port pair */
-     int i;
-     char *cp;
-     char buffer[RFC1413_MAXDATA + 1];
-@@ -129,16 +131,47 @@
-      * addresses from the query socket.
-      */
--    our_query_sin = *our_sin;
--    our_query_sin.sin_port = htons(ANY_PORT);
--#ifdef MPE 
--    our_query_sin.sin_addr.s_addr = INADDR_ANY;
-+#ifndef SIN6_LEN
-+    memcpy(&our_query_sin, our_sin, SA_LEN(our_sin));
-+    memcpy(&rmt_query_sin, rmt_sin, SA_LEN(rmt_sin));
-+#else
-+    memcpy(&our_query_sin, our_sin, our_sin->sa_len);
-+    memcpy(&rmt_query_sin, rmt_sin, rmt_sin->sa_len);
- #endif
--    rmt_query_sin = *rmt_sin;
--    rmt_query_sin.sin_port = htons(RFC1413_PORT);
-+    switch (our_sin->sa_family) {
-+    case AF_INET:
-+#ifdef MPE
-+      ((struct sockaddr_in *)&our_query_sin)->sin_addr.s_addr = INADDR_ANY; /* XXX: htonl(??) */
-+#endif
-+      ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
-+      o_our_port = ntohs(((struct sockaddr_in *)our_sin)->sin_port);
-+      ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC1413_PORT);
-+      o_rmt_port = ntohs(((struct sockaddr_in *)rmt_sin)->sin_port);
-+      break;
-+#ifdef INET6
-+    case AF_INET6:
-+#ifdef MPE
-+      memcpy(&((struct sockaddr_in6 *)&our_query_sin)->sin6_addr, 
-+           &in6addr_any, sizeof(struct in6_addr));
-+#endif
-+      ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
-+      o_our_port = ntohs(((struct sockaddr_in6 *)our_sin)->sin6_port);
-+      ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC1413_PORT);
-+      o_rmt_port = ntohs(((struct sockaddr_in6 *)rmt_sin)->sin6_port);
-+      break;
-+#endif
-+    default:
-+      /* unsupported AF */
-+      return -1;
-+    }
-     if (bind(sock, (struct sockaddr *) &our_query_sin,
--           sizeof(struct sockaddr_in)) < 0) {
-+#ifndef SIN6_LEN
-+           SA_LEN((struct sockaddr *) &our_query_sin)
-+#else
-+           our_query_sin.ss_len
-+#endif
-+           ) < 0) {
-       ap_log_error(APLOG_MARK, APLOG_CRIT, srv,
-                   "bind: rfc1413: Error binding to local port");
-       return -1;
-@@ -149,12 +182,18 @@
-  * the service
-  */
-     if (connect(sock, (struct sockaddr *) &rmt_query_sin,
--              sizeof(struct sockaddr_in)) < 0)
--                  return -1;
-+#ifndef SIN6_LEN
-+              SA_LEN((struct sockaddr *) &rmt_query_sin)
-+#else
-+              rmt_query_sin.ss_len
-+#endif
-+              ) < 0) {
-+      return -1;
-+    }
- /* send the data */
--    buflen = ap_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", ntohs(rmt_sin->sin_port),
--              ntohs(our_sin->sin_port));
-+    buflen = ap_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", o_rmt_port,
-+              o_our_port);
-     /* send query to server. Handle short write. */
- #ifdef CHARSET_EBCDIC
-@@ -219,9 +258,9 @@
-     ascii2ebcdic(buffer, buffer, (size_t)i);
- #endif
-     if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port,
--             user) != 3 || ntohs(rmt_sin->sin_port) != rmt_port
--      || ntohs(our_sin->sin_port) != our_port)
-+             user) != 3 || o_rmt_port != rmt_port || o_our_port != our_port) {
-       return -1;
-+    }
-     /*
-      * Strip trailing carriage return. It is part of the
-@@ -243,7 +282,7 @@
-     result = FROM_UNKNOWN;
--    sock = ap_psocket(conn->pool, AF_INET, SOCK_STREAM, IPPROTO_TCP);
-+    sock = ap_psocket(conn->pool, conn->remote_addr.ss_family, SOCK_STREAM, IPPROTO_TCP);
-     if (sock < 0) {
-       ap_log_error(APLOG_MARK, APLOG_CRIT, srv,
-                   "socket: rfc1413: error creating socket");
-@@ -256,8 +295,10 @@
-     if (ap_setjmp(timebuf) == 0) {
-       ap_set_callback_and_alarm(ident_timeout, ap_rfc1413_timeout);
--      if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv) >= 0)
-+      if (get_rfc1413(sock, (struct sockaddr *)&conn->local_addr,
-+              (struct sockaddr *)&conn->remote_addr, user, srv) >= 0) {
-           result = user;
-+      }
-     }
-     ap_set_callback_and_alarm(NULL, 0);
-     ap_pclosesocket(conn->pool, sock);
-diff -Nur apache_1.3.26.orig/src/main/util.c apache_1.3.26/src/main/util.c
---- apache_1.3.26.orig/src/main/util.c Tue Jun 18 02:59:58 2002
-+++ apache_1.3.26/src/main/util.c      Wed Jun 19 10:26:32 2002
-@@ -2017,52 +2017,87 @@
-  * Parses a host of the form <address>[:port]
-  * :port is permitted if 'port' is not NULL
-  */
--API_EXPORT(unsigned long) ap_get_virthost_addr(char *w, unsigned short *ports)
-+API_EXPORT(struct sockaddr *) ap_get_virthost_addr(char *w, unsigned short *ports)
- {
--    struct hostent *hep;
--    unsigned long my_addr;
--    char *p;
--
--    p = strchr(w, ':');
-+    static struct sockaddr_storage ss;
-+    struct addrinfo hints, *res;
-+    char *p, *r;
-+    char *host;
-+    char *port = "0";
-+    int error;
-+    char servbuf[NI_MAXSERV];
-+
-+    if (w == NULL)
-+      w = "*";
-+    p = r = NULL;
-+    if (*w == '['){
-+      if (r = strrchr(w+1, ']')){
-+          *r = '\0';
-+          p = r + 1;
-+          switch(*p){
-+          case ':':
-+            p++;
-+            /* nobreak; */
-+          case '\0':
-+            w++;
-+            break;
-+          default:
-+            p = NULL;
-+          }
-+      }
-+    }
-+    else{
-+      p = strchr(w, ':');
-+      if (p != NULL && strchr(p+1, ':') != NULL)
-+          p = NULL;
-+    }
-     if (ports != NULL) {
--      *ports = 0;
--      if (p != NULL && strcmp(p + 1, "*") != 0)
--          *ports = atoi(p + 1);
-+      if (p != NULL && *p && strcmp(p + 1, "*") != 0)
-+          port = p + 1;
-     }
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_socktype = SOCK_STREAM;
-     if (p != NULL)
-       *p = '\0';
-     if (strcmp(w, "*") == 0) {
--      if (p != NULL)
--          *p = ':';
--      return htonl(INADDR_ANY);
--    }
--
--    my_addr = ap_inet_addr((char *)w);
--    if (my_addr != INADDR_NONE) {
--      if (p != NULL)
--          *p = ':';
--      return my_addr;
-+      host = NULL;
-+      hints.ai_flags = AI_PASSIVE;
-+      hints.ai_family = ap_default_family;
-+    } else {
-+      host = w;
-+      hints.ai_family = PF_UNSPEC;
-     }
--    hep = gethostbyname(w);
-+    error = getaddrinfo(host, port, &hints, &res);
--    if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) {
--      fprintf(stderr, "Cannot resolve host name %s --- exiting!\n", w);
-+    if (error || !res) {
-+      fprintf(stderr, "ap_get_vitrhost_addr(): getaddrinfo(%s):%s --- exiting!\n", w, gai_strerror(error));
-       exit(1);
-     }
--    if (hep->h_addr_list[1]) {
--      fprintf(stderr, "Host %s has multiple addresses ---\n", w);
-+    if (res->ai_next) {
-+      fprintf(stderr, "ap_get_vitrhost_addr(): Host %s has multiple addresses ---\n", w);
-       fprintf(stderr, "you must choose one explicitly for use as\n");
-       fprintf(stderr, "a virtual host.  Exiting!!!\n");
-       exit(1);
-     }
-+    if (r != NULL)
-+      *r = ']';
-     if (p != NULL)
-       *p = ':';
--    return ((struct in_addr *) (hep->h_addr))->s_addr;
-+    memcpy(&ss, res->ai_addr, res->ai_addrlen);
-+    if (getnameinfo(res->ai_addr, res->ai_addrlen,
-+                  NULL, 0, servbuf, sizeof(servbuf),
-+                  NI_NUMERICSERV)){
-+      fprintf(stderr, "ap_get_virthost_addr(): getnameinfo() failed --- Exiting!!!\n");
-+      exit(1);
-+    }
-+    if (ports) *ports = atoi(servbuf);
-+    freeaddrinfo(res);
-+    return (struct sockaddr *)&ss;
- }
-@@ -2090,7 +2125,8 @@
- #endif
-     char str[MAXHOSTNAMELEN];
-     char *server_hostname = NULL;
--    struct hostent *p;
-+    struct addrinfo hints, *res;
-+    int error;
- #ifdef BEOS /* BeOS returns zero as an error for gethostname */
-     if (gethostname(str, sizeof(str) - 1) == 0) {
-@@ -2103,29 +2139,38 @@
-     }
-     else 
-     {
--        str[sizeof(str) - 1] = '\0';
--        if ((!(p = gethostbyname(str))) 
--            || (!(server_hostname = find_fqdn(a, p)))) {
--            /* Recovery - return the default servername by IP: */
--            if (p && p->h_addr_list && p->h_addr_list[0]) {
--                ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
--              server_hostname = ap_pstrdup(a, str);
--                /* We will drop through to report the IP-named server */
--            }
--        }
--      else
--            /* Since we found a fqdn, return it with no logged message. */
--            return server_hostname;
--    }
--
--    /* If we don't have an fdqn or IP, fall back to the loopback addr */
--    if (!server_hostname) 
--        server_hostname = ap_pstrdup(a, "127.0.0.1");
--    
--    ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, NULL,
--               "%s: Could not determine the server's fully qualified "
--                 "domain name, using %s for ServerName",
--                 ap_server_argv0, server_hostname);
-+       str[sizeof(str) - 1] = '\0';
-+       memset(&hints, 0, sizeof(hints));
-+       hints.ai_family = PF_UNSPEC;
-+       hints.ai_flags = AI_CANONNAME;
-+       error = getaddrinfo(str, NULL, &hints, &res);
-+       if (error)
-+       {
-+              /* Recovery - return the default servername by IP: */
-+
-+           fprintf(stderr, "%s: cannot determine local host name.\n",
-+                 ap_server_argv0);
-+           fprintf(stderr, "Use the ServerName directive to set it manually.\n");
-+           exit(1);
-+
-+           server_hostname = ap_pstrdup(a, res->ai_canonname);
-+       }
-+       else if (1)     /*fqdn found*/
-+       {
-+           /* XXX should check more conditions */
-+           server_hostname = ap_pstrdup(a, res->ai_canonname);
-+       }
-+        else
-+       {
-+           ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, NULL,
-+                        "%s: Could not determine the server's fully qualified "
-+                        "domain name, using %s for ServerName",
-+                        ap_server_argv0, server_hostname);
-+       }
-+
-+       /* Since we found a fdqn, return it with no logged message. */
-+       freeaddrinfo(res);
-+      }
-     
-     return server_hostname;
- }
-@@ -2369,3 +2414,11 @@
-     }
-     *dest = 0;
- }
-+
-+#ifdef NEED_GETADDRINFO
-+#include "getaddrinfo.c"
-+#endif
-+
-+#ifdef NEED_GETNAMEINFO
-+#include "getnameinfo.c"
-+#endif
-diff -Nur apache_1.3.26.orig/src/main/util_script.c apache_1.3.26/src/main/util_script.c
---- apache_1.3.26.orig/src/main/util_script.c  Thu Mar 21 17:07:02 2002
-+++ apache_1.3.26/src/main/util_script.c       Wed Jun 19 10:26:32 2002
-@@ -67,6 +67,7 @@
- #include "http_request.h"     /* for sub_req_lookup_uri() */
- #include "util_script.h"
- #include "util_date.h"                /* For parseHTTPdate() */
-+#include "sa_len.h"
- #ifdef OS2
- #define INCL_DOS
-@@ -203,6 +204,7 @@
-     array_header *hdrs_arr = ap_table_elts(r->headers_in);
-     table_entry *hdrs = (table_entry *) hdrs_arr->elts;
-     int i;
-+    char servbuf[NI_MAXSERV];
-     /* use a temporary table which we'll overlap onto
-      * r->subprocess_env later
-@@ -293,8 +295,16 @@
-     ap_table_addn(e, "SERVER_ADMIN", s->server_admin);        /* Apache */
-     ap_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
--    ap_table_addn(e, "REMOTE_PORT",
--                ap_psprintf(r->pool, "%d", ntohs(c->remote_addr.sin_port)));
-+    servbuf[0] = '\0';
-+    if (!getnameinfo((struct sockaddr *)&c->remote_addr,
-+#ifndef HAVE_SOCKADDR_LEN
-+                   SA_LEN((struct sockaddr *)&c->remote_addr),
-+#else
-+                   c->remote_addr.ss_len,
-+#endif
-+                   NULL, 0, servbuf, sizeof(servbuf), NI_NUMERICSERV)){
-+      ap_table_addn(e, "REMOTE_PORT", ap_pstrdup(r->pool, servbuf));
-+    }
-     if (c->user) {
-       ap_table_addn(e, "REMOTE_USER", c->user);
-diff -Nur apache_1.3.26.orig/src/main/util_uri.c apache_1.3.26/src/main/util_uri.c
---- apache_1.3.26.orig/src/main/util_uri.c     Tue Jun 18 02:59:58 2002
-+++ apache_1.3.26/src/main/util_uri.c  Wed Jun 19 10:26:32 2002
-@@ -419,6 +419,12 @@
-          * the hostname.  If there's a port it is the first colon.
-          */
-         s = memchr(hostinfo, ':', uri - hostinfo);
-+      if (*hostinfo == '[') {
-+          s = memchr(hostinfo+1, ']', uri - hostinfo - 1);
-+          if (s)
-+              s = strchr(s, ':');
-+      } else
-+          s = memchr(hostinfo, ':', uri - hostinfo);              
-         if (s == NULL) {
-             /* we expect the common case to have no port */
-             uptr->hostname = ap_pstrndup(p, hostinfo, uri - hostinfo);
-@@ -475,7 +481,12 @@
-     /* We expect hostinfo to point to the first character of
-      * the hostname.  There must be a port, separated by a colon
-      */
--    s = strchr(hostinfo, ':');
-+    if (*hostinfo == '[') {
-+        s = strchr(hostinfo+1, ']');
-+        if (s)
-+            s = strchr(s, ':');
-+    } else
-+        s = strchr(hostinfo, ':');
-     if (s == NULL) {
-         return HTTP_BAD_REQUEST;
-     }
-diff -Nur apache_1.3.26.orig/src/modules/proxy/mod_proxy.c apache_1.3.26/src/modules/proxy/mod_proxy.c
---- apache_1.3.26.orig/src/modules/proxy/mod_proxy.c   Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/modules/proxy/mod_proxy.c        Wed Jun 19 10:32:29 2002
-@@ -574,11 +574,31 @@
-     struct proxy_remote *new;
-     char *p, *q;
-     int port;
-+    char *bl = NULL, *br = NULL;
-     p = strchr(r, ':');
-     if (p == NULL || p[1] != '/' || p[2] != '/' || p[3] == '\0')
-         return "ProxyRemote: Bad syntax for a remote proxy server";
--    q = strchr(p + 3, ':');
-+    bl = p + 3;
-+    if (*bl == '['){
-+      br = strrchr(bl+1, ']');
-+      if (br){
-+          bl++;
-+          *br = '\0';
-+          if (*(br+1) == ':'){        /* [host]:xx */
-+              q = br+1;
-+          }
-+          else if (*(br+1) == '\0'){  /* [host] */
-+              q = NULL;
-+          }
-+          else
-+              q = strrchr(br, ':');   /* XXX */
-+      }
-+      else
-+          q = strrchr(bl, ':');       /* XXX */
-+    }
-+    else
-+      q = strrchr(bl, ':');
-     if (q != NULL) {
-         if (sscanf(q + 1, "%u", &port) != 1 || port > 65535)
-             return "ProxyRemote: Bad syntax for a remote proxy server (bad port number)";
-@@ -589,7 +609,7 @@
-     *p = '\0';
-     if (strchr(f, ':') == NULL)
-         ap_str_tolower(f);      /* lowercase scheme */
--    ap_str_tolower(p + 3);      /* lowercase hostname */
-+    ap_str_tolower(bl);         /* lowercase hostname */
-     if (port == -1) {
-         int i;
-@@ -602,7 +622,7 @@
-     new = ap_push_array(conf->proxies);
-     new->scheme = f;
-     new->protocol = r;
--    new->hostname = p + 3;
-+    new->hostname = bl;
-     new->port = port;
-     return NULL;
- }
-diff -Nur apache_1.3.26.orig/src/modules/proxy/mod_proxy.h apache_1.3.26/src/modules/proxy/mod_proxy.h
---- apache_1.3.26.orig/src/modules/proxy/mod_proxy.h   Sun Apr 21 13:35:07 2002
-+++ apache_1.3.26/src/modules/proxy/mod_proxy.h        Wed Jun 19 10:26:32 2002
-@@ -310,7 +310,7 @@
- int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p);
- int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p);
- int ap_proxy_is_word(struct dirconn_entry *This, pool *p);
--int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r);
-+int ap_proxy_doconnect(int sock, struct sockaddr *addr, request_rec *r);
- int ap_proxy_garbage_init(server_rec *, pool *);
- /* This function is called by ap_table_do() for all header lines */
- int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
-diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_connect.c apache_1.3.26/src/modules/proxy/proxy_connect.c
---- apache_1.3.26.orig/src/modules/proxy/proxy_connect.c       Mon Mar 25 10:21:58 2002
-+++ apache_1.3.26/src/modules/proxy/proxy_connect.c    Wed Jun 19 10:38:06 2002
-@@ -113,14 +113,15 @@
-                                  const char *proxyhost, int proxyport)
- {
-     struct sockaddr_in server;
--    struct in_addr destaddr;
--    struct hostent server_hp;
--    const char *host, *err;
-+    struct addrinfo hints, *res, *res0;
-+    const char *hoststr;
-+    const char *portstr = NULL;
-     char *p;
-     int port, sock;
-     char buffer[HUGE_STRING_LEN];
--    int nbytes, i, j;
-+    int nbytes, i;
-     fd_set fds;
-+    int error;
-     void *sconf = r->server->module_config;
-     proxy_server_conf *conf =
-@@ -128,27 +129,59 @@
-     struct noproxy_entry *npent = (struct noproxy_entry *) conf->noproxies->elts;
-     memset(&server, '\0', sizeof(server));
-+#ifdef HAVE_SOCKADDR_LEN
-+    server.sin_len = sizeof(server);
-+#endif
-     server.sin_family = AF_INET;
-     /* Break the URL into host:port pairs */
--    host = url;
-+    hoststr = url;
-     p = strchr(url, ':');
--    if (p == NULL)
--        port = DEFAULT_HTTPS_PORT;
--    else {
--        port = atoi(p + 1);
-+    if (p == NULL) {
-+      char pbuf[32];
-+      ap_snprintf(pbuf, sizeof(pbuf), "%d", DEFAULT_HTTPS_PORT);
-+      portstr = pbuf;
-+    } else {
-+      portstr = p + 1;
-         *p = '\0';
-     }
-+    port = atoi(portstr);
-+
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = PF_UNSPEC;
-+    hints.ai_socktype = SOCK_STREAM;
-+    hints.ai_protocol = IPPROTO_TCP;
-+    error = getaddrinfo(hoststr, portstr, &hints, &res0);
-+    if (error) {
-+      return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-+                  gai_strerror(error));       /* give up */
-+    }
- /* check if ProxyBlock directive on this host */
--    destaddr.s_addr = ap_inet_addr(host);
--    for (i = 0; i < conf->noproxies->nelts; i++) {
--        if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL)
--            || destaddr.s_addr == npent[i].addr.s_addr
--            || npent[i].name[0] == '*')
-+    for (res = res0; res; res = res = res->ai_next) {
-+      struct sockaddr_in *sin;
-+      int fail;
-+
-+      fail = 0;
-+      for (i = 0; i < conf->noproxies->nelts; i++) {
-+          if (npent[i].name != NULL && strstr(hoststr, npent[i].name))
-+              fail++;
-+          if (npent[i].name != NULL && strcmp(npent[i].name, "*") == 0)
-+              fail++;
-+          switch (res->ai_family) {
-+          case AF_INET:
-+              sin = (struct sockaddr_in *)res->ai_addr;
-+              if (sin->sin_addr.s_addr == npent[i].addr.s_addr)
-+                  fail++;
-+              break;
-+          }
-+      }
-+      if (fail) {
-+          freeaddrinfo(res0);
-             return ap_proxyerror(r, HTTP_FORBIDDEN,
-                                  "Connect to remote machine blocked");
-+      }
-     }
-     /* Check if it is an allowed port */
-@@ -159,34 +192,42 @@
-         case DEFAULT_SNEWS_PORT:
-             break;
-         default:
-+            freeaddrinfo(res0);
-             return HTTP_FORBIDDEN;
-         }
-     }
--    else if (!allowed_port(conf, port))
-+    else if (!allowed_port(conf, port)) {
-+        freeaddrinfo(res0);
-         return HTTP_FORBIDDEN;
-+    }
-     if (proxyhost) {
-+      char pbuf[10];
-+
-+      freeaddrinfo(res0);
-+
-+      ap_snprintf(pbuf, sizeof(pbuf), "%d", proxyport);
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_socktype = SOCK_STREAM;
-+      hints.ai_protocol = IPPROTO_TCP;
-+      error = getaddrinfo(proxyhost, pbuf, &hints, &res0);
-+      if (error)
-+          return HTTP_INTERNAL_SERVER_ERROR;  /* XXX */
-+
-         ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server,
-              "CONNECT to remote proxy %s on port %d", proxyhost, proxyport);
-     }
-     else {
-         ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server,
--                     "CONNECT to %s on port %d", host, port);
-+                     "CONNECT to %s on port %d", hoststr, port);
-     }
--    /* Nasty cast to work around broken terniary expressions on MSVC */
--    server.sin_port = htons((unsigned short)(proxyport ? proxyport : port));
--    err = ap_proxy_host2addr(proxyhost ? proxyhost : host, &server_hp);
--
--    if (err != NULL)
--        return ap_proxyerror(r,
--            proxyhost ? HTTP_BAD_GATEWAY : HTTP_INTERNAL_SERVER_ERROR, err);
--
--    sock = ap_psocket(r->pool, PF_INET, SOCK_STREAM, IPPROTO_TCP);
--    if (sock == -1) {
--        ap_log_rerror(APLOG_MARK, APLOG_ERR, r, "proxy: error creating socket");
--        return HTTP_INTERNAL_SERVER_ERROR;
--    }
-+    sock = i = -1;
-+    for (res = res0; res; res = res->ai_next) {
-+      sock = ap_psocket(r->pool, res->ai_family, res->ai_socktype, res->ai_protocol);
-+      if (sock == -1)
-+          continue;
- #ifdef CHECK_FD_SETSIZE
-     if (sock >= FD_SETSIZE) {
-@@ -196,19 +237,15 @@
-                      "found, you probably need to rebuild Apache with a "
-                      "larger FD_SETSIZE", sock, FD_SETSIZE);
-         ap_pclosesocket(r->pool, sock);
--        return HTTP_INTERNAL_SERVER_ERROR;
-+      continue;
-     }
- #endif
--    j = 0;
--    while (server_hp.h_addr_list[j] != NULL) {
--        memcpy(&server.sin_addr, server_hp.h_addr_list[j],
--               sizeof(struct in_addr));
--        i = ap_proxy_doconnect(sock, &server, r);
-+      i = ap_proxy_doconnect(sock, res->ai_addr, r);
-         if (i == 0)
-             break;
--        j++;
-     }
-+    freeaddrinfo(res0);
-     if (i == -1) {
-         ap_pclosesocket(r->pool, sock);
-         return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, ap_pstrcat(r->pool,
-diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_ftp.c apache_1.3.26/src/modules/proxy/proxy_ftp.c
---- apache_1.3.26.orig/src/modules/proxy/proxy_ftp.c   Sun Apr  7 20:57:36 2002
-+++ apache_1.3.26/src/modules/proxy/proxy_ftp.c        Wed Jun 19 10:49:53 2002
-@@ -62,6 +62,7 @@
- #include "http_main.h"
- #include "http_log.h"
- #include "http_core.h"
-+#include "sa_len.h"
- #define AUTODETECT_PWD
-@@ -555,8 +556,10 @@
-     const char *err;
-     int port, i, j, len, rc, nocache = 0;
-     int csd = 0, sock = -1, dsock = -1;
--    struct sockaddr_in server;
--    struct hostent server_hp;
-+    struct sockaddr_storage server;
-+    struct addrinfo hints, *res, *res0;
-+    char portbuf[10];
-+    int error;
-     struct in_addr destaddr;
-     table *resp_hdrs;
-     BUFF *ctrl = NULL;
-@@ -577,11 +580,18 @@
-     unsigned int presult, h0, h1, h2, h3, p0, p1;
-     unsigned int paddr;
-     unsigned short pport;
--    struct sockaddr_in data_addr;
-+    struct sockaddr_storage data_addr;
-+    struct sockaddr_in *sin;
-     int pasvmode = 0;
-     char pasv[64];
-     char *pstr;
-+/* stuff for LPSV/EPSV */
-+    unsigned int paf, holen, ho[16], polen, po[2];
-+    struct sockaddr_in6 *sin6;
-+    int lpsvmode = 0;
-+    char *cmd;
-+
- /* stuff for responses */
-     char resp[MAX_STRING_LEN];
-     char *size = NULL;
-@@ -658,62 +668,52 @@
-     if (parms != NULL)
-         *(parms++) = '\0';
--    memset(&server, 0, sizeof(struct sockaddr_in));
--    server.sin_family = AF_INET;
--    server.sin_port = htons((unsigned short)port);
--    err = ap_proxy_host2addr(host, &server_hp);
--    if (err != NULL)
--        return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
--
--    sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
--    if (sock == -1) {
--        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
--                      "proxy: error creating socket");
--        return HTTP_INTERNAL_SERVER_ERROR;
--    }
-+    ap_snprintf(portbuf, sizeof(portbuf), "%d", port);
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = PF_UNSPEC;
-+    hints.ai_socktype = SOCK_STREAM;
-+    error = getaddrinfo(host, portbuf, &hints, &res0);
-+    if (error) {
-+      return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-+          gai_strerror(error));
-+    }
-+
-+    i = -1;
-+    for (res = res0; res; res = res->ai_next) {
-+      sock = ap_psocket(p, res->ai_family, res->ai_socktype,
-+          res->ai_protocol);
-+      if (sock == -1)
-+          continue;
- #if !defined(TPF) && !defined(BEOS)
--    if (conf->recv_buffer_size > 0
--        && setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
--                      (const char *)&conf->recv_buffer_size, sizeof(int))
--        == -1) {
--        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
--                      "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
--    }
-+      if (conf->recv_buffer_size > 0
-+          && setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-+                        (const char *)&conf->recv_buffer_size, sizeof(int))
-+              == -1) {
-+              ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-+                           "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
-+      }
- #endif
--    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one,
--                   sizeof(one)) == -1) {
-+      if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one,
-+                     sizeof(one)) == -1) {
- #ifndef _OSD_POSIX              /* BS2000 has this option "always on" */
--        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
--         "proxy: error setting reuseaddr option: setsockopt(SO_REUSEADDR)");
--        ap_pclosesocket(p, sock);
--        return HTTP_INTERNAL_SERVER_ERROR;
-+          ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-+                       "proxy: error setting reuseaddr option: setsockopt(SO_REUSEADDR)");
-+          ap_pclosesocket(p, sock);
-+          freeaddrinfo(res0);
-+          return HTTP_INTERNAL_SERVER_ERROR;
- #endif                          /* _OSD_POSIX */
--    }
--
--#ifdef SINIX_D_RESOLVER_BUG
--    {
--        struct in_addr *ip_addr = (struct in_addr *)*server_hp.h_addr_list;
--
--        for (; ip_addr->s_addr != 0; ++ip_addr) {
--            memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr));
--            i = ap_proxy_doconnect(sock, &server, r);
--            if (i == 0)
--                break;
-         }
--    }
--#else
--    j = 0;
--    while (server_hp.h_addr_list[j] != NULL) {
--        memcpy(&server.sin_addr, server_hp.h_addr_list[j],
--               sizeof(struct in_addr));
--        i = ap_proxy_doconnect(sock, &server, r);
--        if (i == 0)
-+
-+      i = ap_proxy_doconnect(sock, res->ai_addr, r);
-+      if (i == 0) {
-+          memcpy(&server, res->ai_addr, res->ai_addrlen);
-             break;
--        j++;
-+      }
-+      ap_pclosesocket(p, sock);
-     }
--#endif
-+    freeaddrinfo(res0);
-     if (i == -1) {
-         return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                       ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
-@@ -944,7 +944,7 @@
-     }
- /* try to set up PASV data connection first */
--    dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
-+    dsock = ap_psocket(p, server.ss_family, SOCK_STREAM, IPPROTO_TCP);
-     if (dsock == -1) {
-         return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                                 ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-@@ -961,11 +961,22 @@
-     }
- #endif
--    ap_bputs("PASV" CRLF, ctrl);
-+lpsvagain:
-+    if (server.ss_family == AF_INET)
-+      cmd = "PASV";
-+    else if (lpsvmode)
-+      cmd = "LPSV";
-+    else
-+      cmd = "EPSV";
-+    ap_bputs(cmd, ctrl);
-+    ap_bputs(CRLF, ctrl);
-     ap_bflush(ctrl);
-+    Explain0("FTP: passive command issued");
-     ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "FTP: PASV command issued");
--/* possible results: 227, 421, 500, 501, 502, 530 */
-+/* possible results: 227, 228, 229, 421, 500, 501, 502, 530 */
-     /* 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). */
-+    /* 228 Entering Long Passive Mode (...). */
-+    /* 229 Entering Extended Passive Mode (...). */
-     /* 421 Service not available, closing control connection. */
-     /* 500 Syntax error, command unrecognized. */
-     /* 501 Syntax error in parameters or arguments. */
-@@ -976,7 +987,7 @@
-     if (i == -1 || i == 421) {
-         return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                                 ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
--                               "proxy: PASV: control connection is toast"));
-+                                  ap_psprintf(p, "proxy: %s: control connection is toast", cmd)));
-     }
-     else {
-         pasv[i - 1] = '\0';
-@@ -1004,10 +1015,14 @@
-             pport = (p1 << 8) + p0;
-             ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "FTP: contacting host %d.%d.%d.%d:%d",
-                          h3, h2, h1, h0, pport);
--            data_addr.sin_family = AF_INET;
--            data_addr.sin_addr.s_addr = htonl(paddr);
--            data_addr.sin_port = htons(pport);
--            i = ap_proxy_doconnect(dsock, &data_addr, r);
-+          sin = (struct sockaddr_in *)&data_addr;
-+          sin->sin_family = AF_INET;
-+#ifdef SIN6_LEN
-+          sin->sin_len = sizeof(*sin);
-+#endif
-+          sin->sin_addr.s_addr = htonl(paddr);
-+          sin->sin_port = htons(pport);
-+          i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
-             if (i == -1) {
-                 return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-@@ -1017,6 +1032,64 @@
-                                                    strerror(errno), NULL)));
-             }
-             pasvmode = 1;
-+      } else if (presult == 228 && pstr != NULL
-+              && sscanf(pstr,
-+"%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u",
-+                  &paf, &holen, &ho[0], &ho[1], &ho[2], &ho[3],
-+                  &ho[4], &ho[5], &ho[6], &ho[7], &ho[8], &ho[9], &ho[10], &ho[11],
-+                  &ho[12], &ho[13], &ho[14], &ho[15], &polen, &po[0], &po[1]) == 21
-+              && paf == 6 && holen == 16 && polen == 2) {
-+          int i;
-+          sin6 = (struct sockaddr_in6 *)&data_addr;
-+          sin6->sin6_family = AF_INET6;
-+#ifdef SIN6_LEN
-+          sin6->sin6_len = sizeof(*sin6);
-+#endif
-+          for (i = 0; i < 16; i++)
-+              sin6->sin6_addr.s6_addr[i] = ho[i] & 0xff;
-+          sin6->sin6_port = htons(((po[0] & 0xff) << 8) | (po[1] & 0xff));
-+          i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
-+
-+          if (i == -1) {
-+              return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-+                        ap_proxyerror(r, HTTP_BAD_GATEWAY,
-+                           ap_pstrcat(r->pool,
-+                                      "Could not connect to remote machine: ",
-+                                      strerror(errno), NULL)));
-+          }
-+          pasvmode = 1;
-+      } else if (presult == 229 && pstr != NULL
-+              && pstr[0] == pstr[1] && pstr[0] == pstr[2]
-+              && pstr[0] == pstr[strlen(pstr) - 1]) {
-+          /* expect "|||port|" */
-+#ifndef SIN6_LEN
-+          memcpy(&data_addr, &server, SA_LEN((struct sockaddr *)&server));
-+#else
-+          memcpy(&data_addr, &server, server.ss_len);
-+#endif
-+          switch (data_addr.ss_family) {
-+          case AF_INET:
-+              sin = (struct sockaddr_in *)&data_addr;
-+              sin->sin_port = htons(atoi(pstr + 3));
-+              break;
-+          case AF_INET6:
-+              sin6 = (struct sockaddr_in6 *)&data_addr;
-+              sin6->sin6_port = htons(atoi(pstr + 3));
-+              break;
-+          }
-+          i = ap_proxy_doconnect(dsock, (struct sockaddr *)&data_addr, r);
-+
-+          if (i == -1) {
-+              return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-+                        ap_proxyerror(r, HTTP_BAD_GATEWAY,
-+                           ap_pstrcat(r->pool,
-+                                      "Could not connect to remote machine: ",
-+                                      strerror(errno), NULL)));
-+          }
-+          pasvmode = 1;
-+      } else if (!lpsvmode && strcmp(cmd, "EPSV") == 0) {
-+          lpsvmode = 1;
-+          goto lpsvagain;
-         }
-         else {
-             ap_pclosesocket(p, dsock);  /* and try the regular way */
-@@ -1025,14 +1098,14 @@
-     }
-     if (!pasvmode) {            /* set up data connection */
--        clen = sizeof(struct sockaddr_in);
-+        clen = sizeof(server);
-         if (getsockname(sock, (struct sockaddr *)&server, &clen) < 0) {
-             return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                                 ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-                                     "proxy: error getting socket address"));
-         }
--        dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
-+        dsock = ap_psocket(p, server.ss_family, SOCK_STREAM, IPPROTO_TCP);
-         if (dsock == -1) {
-             return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                                 ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-@@ -1048,13 +1121,28 @@
- #endif                          /* _OSD_POSIX */
-         }
--        if (bind(dsock, (struct sockaddr *)&server,
--                 sizeof(struct sockaddr_in)) == -1) {
-+#ifndef SIN6_LEN
-+      if (bind(dsock, (struct sockaddr *)&server, SA_LEN((struct sockaddr *)&server)) == -1)
-+#else
-+      if (bind(dsock, (struct sockaddr *)&server, server.ss_len) == -1)
-+#endif
-+      {
-+          char hostnamebuf[MAXHOSTNAMELEN], portnamebuf[MAXHOSTNAMELEN];
-+
-+          getnameinfo((struct sockaddr *)&server,
-+#ifndef SIN6_LEN
-+                  SA_LEN((struct sockaddr *)&server),
-+#else
-+                  server.ss_len,
-+#endif
-+              hostnamebuf, sizeof(hostnamebuf),
-+              portnamebuf, sizeof(portnamebuf),
-+              NI_NUMERICHOST | NI_NUMERICSERV);
-             return ftp_cleanup_and_return(r, ctrl, data, sock, dsock,
-                                 ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
--             ap_psprintf(p, "proxy: error binding to ftp data socket %s:%d",
--                         inet_ntoa(server.sin_addr), server.sin_port)));
-+             ap_psprintf(p, "proxy: error binding to ftp data socket %s:%s",
-+                         hostnamebuf, portnamebuf)));
-         }
-         listen(dsock, 2);       /* only need a short queue */
-     }
-@@ -1308,7 +1396,7 @@
-     if (!pasvmode) {            /* wait for connection */
-         ap_hard_timeout("proxy ftp data connect", r);
--        clen = sizeof(struct sockaddr_in);
-+        clen = sizeof(server);
-         do
-             csd = accept(dsock, (struct sockaddr *)&server, &clen);
-         while (csd == -1 && errno == EINTR);
-diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_http.c apache_1.3.26/src/modules/proxy/proxy_http.c
---- apache_1.3.26.orig/src/modules/proxy/proxy_http.c  Wed Jun 19 10:25:56 2002
-+++ apache_1.3.26/src/modules/proxy/proxy_http.c       Wed Jun 19 11:00:47 2002
-@@ -156,9 +156,8 @@
-     table *req_hdrs, *resp_hdrs;
-     array_header *reqhdrs_arr;
-     table_entry *reqhdrs_elts;
--    struct sockaddr_in server;
--    struct in_addr destaddr;
--    struct hostent server_hp;
-+    struct addrinfo hints, *res, *res0;
-+    int error;
-     BUFF *f;
-     char buffer[HUGE_STRING_LEN];
-     char portstr[32];
-@@ -184,9 +183,6 @@
-     if (conf->cache.root == NULL)
-         nocache = 1;
--    memset(&server, '\0', sizeof(server));
--    server.sin_family = AF_INET;
--
-     /* We break the URL into host, port, path-search */
-     urlptr = strstr(url, "://");
-@@ -194,6 +190,8 @@
-         return HTTP_BAD_REQUEST;
-     urlptr += 3;
-     destport = DEFAULT_HTTP_PORT;
-+    ap_snprintf(portstr, sizeof(portstr), "%d", DEFAULT_HTTP_PORT);
-+    destportstr = portstr;           
- #ifdef EAPI
-     ap_hook_use("ap::mod_proxy::http::handler::set_destport", 
-                 AP_HOOK_SIG2(int,ptr), 
-@@ -212,7 +210,20 @@
-         urlptr = strp;
-         desthost = q;
-     }
--
-+   if (*desthost == '['){
-+       char *u = strrchr(desthost+1, ']');
-+       if (u){
-+         desthost++;
-+         *u = '\0';
-+         if (*(u+1) == ':'){ /* [host]:xx */
-+             strp2 = u+1;
-+         } else if (*(u+1) == '\0'){   /* [host] */
-+             strp2 = NULL;
-+         } else
-+             return HTTP_BAD_REQUEST;
-+      } else
-+          return HTTP_BAD_REQUEST;
-+   } else
-     strp2 = strchr(desthost, ':');
-     if (strp2 != NULL) {
-         *(strp2++) = '\0';
-@@ -223,46 +234,70 @@
-     }
-     /* check if ProxyBlock directive on this host */
--    destaddr.s_addr = ap_inet_addr(desthost);
--    for (i = 0; i < conf->noproxies->nelts; i++) {
--        if (destaddr.s_addr == npent[i].addr.s_addr ||
--            (npent[i].name != NULL &&
--             (npent[i].name[0] == '*' || strstr(desthost, npent[i].name) != NULL)))
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = PF_UNSPEC;
-+    hints.ai_socktype = SOCK_STREAM;
-+    hints.ai_protocol = IPPROTO_TCP;
-+    error = getaddrinfo(desthost, destportstr, &hints, &res0);
-+    if (error) {
-+        return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR,
-+               gai_strerror(error));       /* give up */
-+    }
-+    
-+    /* check if ProxyBlock directive on this host */
-+    for (res = res0; res; res = res->ai_next) {
-+        struct sockaddr_in *sin;
-+#ifdef INET6
-+        struct sockaddr_in6 *sin6;
-+#endif
-+        int fail;
-+
-+        fail = 0;
-+        for (i = 0; i < conf->noproxies->nelts; i++) {
-+            if (npent[i].name != NULL && strstr(desthost, npent[i].name))
-+                fail++;
-+            if (npent[i].name != NULL && strcmp(npent[i].name, "*") == 0)
-+                fail++;
-+            switch (res->ai_family) {
-+                case AF_INET:
-+                    sin = (struct sockaddr_in *)res->ai_addr;
-+                    if (sin->sin_addr.s_addr == npent[i].addr.s_addr)
-+                        fail++;
-+                    break;
-+           }
-+        }
-+        if (fail) {
-+            freeaddrinfo(res0);
-             return ap_proxyerror(r, HTTP_FORBIDDEN,
-                                  "Connect to remote machine blocked");
-+      }
-     }
-     if (proxyhost != NULL) {
--        server.sin_port = htons((unsigned short)proxyport);
--        err = ap_proxy_host2addr(proxyhost, &server_hp);
--        if (err != NULL)
-+        char pbuf[10];
-+
-+        freeaddrinfo(res0);
-+        ap_snprintf(pbuf, sizeof(pbuf), "%d", proxyport);
-+        memset(&hints, 0, sizeof(hints));
-+        hints.ai_family = PF_UNSPEC;
-+        hints.ai_socktype = SOCK_STREAM;
-+        hints.ai_protocol = IPPROTO_TCP;
-+        error = getaddrinfo(proxyhost, pbuf, &hints, &res0);
-+        if (error)
-             return DECLINED;    /* try another */
- #ifdef EAPI
-       peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);  
- #endif
-     }
--    else {
--        server.sin_port = htons((unsigned short)destport);
--        err = ap_proxy_host2addr(desthost, &server_hp);
--        if (err != NULL)
--            return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
--#ifdef EAPI
--      peer =  ap_psprintf(p, "%s:%u", desthost, destport);  
--#endif
--    }
--
--
--    /*
--     * we have worked out who exactly we are going to connect to, now make
--     * that connection...
--     */
--    sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
--    if (sock == -1) {
--        ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
--                      "proxy: error creating socket");
--        return HTTP_INTERNAL_SERVER_ERROR;
--    }
-+ 
-+    sock = i = -1;
-+    for (res = res0; res; res = res->ai_next) {
-+        sock = ap_psocket(p, res->ai_family, res->ai_socktype,
-+                res->ai_protocol);
-+        if (sock < 0)
-+            continue;
-+ 
- #if !defined(TPF) && !defined(BEOS)
-     if (conf->recv_buffer_size) {
-         if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-@@ -274,28 +309,12 @@
-     }
- #endif
--#ifdef SINIX_D_RESOLVER_BUG
--    {
--        struct in_addr *ip_addr = (struct in_addr *)*server_hp.h_addr_list;
--
--        for (; ip_addr->s_addr != 0; ++ip_addr) {
--            memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr));
--            i = ap_proxy_doconnect(sock, &server, r);
--            if (i == 0)
--                break;
--        }
--    }
--#else
--    j = 0;
--    while (server_hp.h_addr_list[j] != NULL) {
--        memcpy(&server.sin_addr, server_hp.h_addr_list[j],
--               sizeof(struct in_addr));
--        i = ap_proxy_doconnect(sock, &server, r);
-+      i = ap_proxy_doconnect(sock, res->ai_addr, r);
-         if (i == 0)
-             break;
--        j++;
-+      ap_pclosesocket(p, sock); 
-     }
--#endif
-+    freeaddrinfo(res0);
-     if (i == -1) {
-         if (proxyhost != NULL)
-             return DECLINED;    /* try again another way */
-@@ -599,17 +618,30 @@
-         ap_table_set(resp_hdrs, "Content-Location", proxy_location_reverse_map(r, urlstr));
- /* check if NoCache directive on this host */
-+  {
-+    struct sockaddr_in *sin;
-+#ifdef INET6
-+    struct sockaddr_in6 *sin6;
-+#endif
-+
-     if (nocache == 0) {
-         for (i = 0; i < conf->nocaches->nelts; i++) {
--            if (destaddr.s_addr == ncent[i].addr.s_addr ||
--                (ncent[i].name != NULL &&
--                 (ncent[i].name[0] == '*' ||
--                  strstr(desthost, ncent[i].name) != NULL))) {
--                nocache = 1;
--                break;
-+          if (ncent[i].name != NULL && 
-+              (ncent[i].name[0] == '*' ||
-+               strstr(desthost, ncent[i].name) != NULL)) {
-+              nocache = 1;
-+              break;
-+          }
-+          switch (res->ai_addr->sa_family) {
-+          case AF_INET:
-+              sin = (struct sockaddr_in *)res->ai_addr;
-+              if (sin->sin_addr.s_addr == ncent[i].addr.s_addr) {
-+                  nocache = 1;
-+                  break;
-+              }
-             }
-         }
--
-+    }
-         /*
-          * update the cache file, possibly even fulfilling the request if it
-          * turns out a conditional allowed us to serve the object from the
-diff -Nur apache_1.3.26.orig/src/modules/proxy/proxy_util.c apache_1.3.26/src/modules/proxy/proxy_util.c
---- apache_1.3.26.orig/src/modules/proxy/proxy_util.c  Tue Jun 18 02:59:59 2002
-+++ apache_1.3.26/src/modules/proxy/proxy_util.c       Wed Jun 19 11:05:11 2002
-@@ -64,6 +64,7 @@
- #include "http_log.h"
- #include "util_uri.h"
- #include "util_date.h"          /* get ap_checkmask() decl. */
-+#include "sa_len.h"
- static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r);
- static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
-@@ -219,6 +220,7 @@
-     int i;
-     char *strp, *host, *url = *urlp;
-     char *user = NULL, *password = NULL;
-+    char *t = NULL, *u = NULL, *v = NULL;
-     if (url[0] != '/' || url[1] != '/')
-         return "Malformed URL";
-@@ -257,11 +259,22 @@
-         *passwordp = password;
-     }
--    strp = strrchr(host, ':');
--    if (strp != NULL) {
--        *(strp++) = '\0';
--
--        for (i = 0; strp[i] != '\0'; i++)
-+    v = host;
-+    if (*host == '['){
-+      u = strrchr(host, ']');
-+      if (u){
-+          host++;
-+          *u = '\0';
-+          v = u + 1;
-+      }
-+    }
-+    t = strrchr(v, ':');
-+    if (t){
-+      *t = '\0';
-+      strp = t + 1;
-+    }
-+    if (strp) {
-+      for (i=0; strp[i] != '\0'; i++)
-             if (!ap_isdigit(strp[i]))
-                 break;
-@@ -280,17 +293,29 @@
-         return "Missing host in URL";
- /* check hostname syntax */
-     for (i = 0; host[i] != '\0'; i++)
--        if (!ap_isdigit(host[i]) && host[i] != '.')
-+        if (!ap_isdigit(host[i]) && host[i] != '.' && host[i] != ':')
-             break;
-     /* must be an IP address */
- #if defined(WIN32) || defined(NETWARE) || defined(TPF) || defined(BEOS)
-     if (host[i] == '\0' && (inet_addr(host) == -1))
-+      return "Bad IP address in URL";
-+#else
-+    if (host[i] == '\0') {
-+      struct addrinfo hints, *res0;
-+      int gai;
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_flags = AI_NUMERICHOST;
-+      if (gai = getaddrinfo(host, NULL, &hints, &res0)) {
-+#if 0
-+          return gai_strerror(gai);
- #else
--    if (host[i] == '\0' && (ap_inet_addr(host) == -1 || inet_network(host) == -1))
-+          return "Bad IP address in URL";
- #endif
--    {
--        return "Bad IP address in URL";
-+      }
-+      freeaddrinfo(res0);
-     }
-+#endif
- /*    if (strchr(host,'.') == NULL && domain != NULL)
-    host = pstrcat(p, host, domain, NULL);
-@@ -1359,22 +1384,46 @@
-     return host != NULL && strstr(host, This->name) != NULL;
- }
--int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r)
-+int ap_proxy_doconnect(int sock, struct sockaddr *addr, request_rec *r)
- {
-     int i;
-+    int salen;
-+    char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
-+#ifdef NI_WITHSCOPEID
-+    const int niflags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
-+#else
-+    const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
-+#endif
-     ap_hard_timeout("proxy connect", r);
-+#ifdef HAVE_SOCKADDR_LEN
-+    salen = addr->sa_len;
-+#else
-+    switch (addr->sa_family) {
-+    case AF_INET6:
-+      salen = sizeof(struct sockaddr_in6);
-+      break;
-+    default:
-+      salen = sizeof(struct sockaddr_in);
-+      break;
-+    }
-+#endif
-     do {
--        i = connect(sock, (struct sockaddr *)addr, sizeof(struct sockaddr_in));
-+        i = connect(sock, addr, salen);
- #if defined(WIN32) || defined(NETWARE)
-         if (i == SOCKET_ERROR)
-             errno = WSAGetLastError();
- #endif                          /* WIN32 */
-     } while (i == -1 && errno == EINTR);
-     if (i == -1) {
-+      if (getnameinfo(addr, salen, hbuf, sizeof(hbuf), pbuf, sizeof(pbuf),
-+              niflags) != 0) {
-+          strcpy(hbuf, "?");
-+          strcpy(pbuf, "?");
-+      }
-         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-                       "proxy connect to %s port %d failed",
--                      inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
-+                      hbuf, pbuf);
-     }
-     ap_kill_timeout(r);
-diff -Nur apache_1.3.26.orig/src/modules/standard/mod_access.c apache_1.3.26/src/modules/standard/mod_access.c
---- apache_1.3.26.orig/src/modules/standard/mod_access.c       Wed Mar 13 22:05:33 2002
-+++ apache_1.3.26/src/modules/standard/mod_access.c    Wed Jun 19 10:26:32 2002
-@@ -74,7 +74,10 @@
-     T_ALL,
-     T_IP,
-     T_HOST,
--    T_FAIL
-+    T_FAIL,
-+#ifdef INET6
-+    T_IP6,
-+#endif
- };
- typedef struct {
-@@ -82,9 +85,15 @@
-     union {
-       char *from;
-       struct {
--          unsigned long net;
--          unsigned long mask;
-+          struct in_addr net;
-+          struct in_addr mask;
-       } ip;
-+#ifdef INET6
-+      struct {
-+          struct in6_addr net6;
-+          struct in6_addr mask6;
-+      } ip6;
-+#endif
-     } x;
-     enum allowdeny_type type;
- } allowdeny;
-@@ -167,90 +176,230 @@
-     }
-     else if ((s = strchr(where, '/'))) {
--      unsigned long mask;
-+      struct addrinfo hints, *resnet, *resmask;
-+      struct sockaddr_storage net, mask;
-+      int error;
-+      char *p;
-+      int justdigits;
--      a->type = T_IP;
-+      a->type = T_FAIL;       /*just in case*/
-       /* trample on where, we won't be using it any more */
-       *s++ = '\0';
--      if (!is_ip(where)
--          || (a->x.ip.net = ap_inet_addr(where)) == INADDR_NONE) {
-+      justdigits = 0;
-+      for (p = s; *p; p++) {
-+          if (!isdigit(*p))
-+              break;
-+      }
-+      if (!*p)
-+          justdigits++;
-+
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_socktype = SOCK_STREAM;        /*dummy*/
-+#ifdef AI_NUMERICHOST
-+      hints.ai_flags = AI_NUMERICHOST;        /*don't resolve*/
-+#endif
-+      resnet = NULL;
-+      error = getaddrinfo(where, NULL, &hints, &resnet);
-+      if (error || !resnet) {
-+          if (resnet)
-+              freeaddrinfo(resnet);
-           a->type = T_FAIL;
-           return "syntax error in network portion of network/netmask";
-       }
-+      if (resnet->ai_next) {
-+          freeaddrinfo(resnet);
-+          a->type = T_FAIL;
-+          return "network/netmask resolved to multiple addresses";
-+      }
-+      memcpy(&net, resnet->ai_addr, resnet->ai_addrlen);
-+      freeaddrinfo(resnet);
--      /* is_ip just tests if it matches [\d.]+ */
--      if (!is_ip(s)) {
-+      switch (net.ss_family) {
-+      case AF_INET:
-+          a->type = T_IP;
-+          a->x.ip.net.s_addr = ((struct sockaddr_in *)&net)->sin_addr.s_addr;
-+          break;
-+#ifdef INET6
-+      case AF_INET6:
-+          a->type = T_IP6;
-+          memcpy(&a->x.ip6.net6, &((struct sockaddr_in6 *)&net)->sin6_addr,
-+              sizeof(a->x.ip6.net6));
-+          break;
-+#endif
-+      default:
-           a->type = T_FAIL;
--          return "syntax error in mask portion of network/netmask";
-+          return "unknown address family for network";
-       }
--      /* is it in /a.b.c.d form? */
--      if (strchr(s, '.')) {
--          mask = ap_inet_addr(s);
--          if (mask == INADDR_NONE) {
-+
-+      if (!justdigits) {
-+          memset(&hints, 0, sizeof(hints));
-+          hints.ai_family = PF_UNSPEC;
-+          hints.ai_socktype = SOCK_STREAM;    /*dummy*/ 
-+#ifdef AI_NUMERICHOST
-+          hints.ai_flags = AI_NUMERICHOST;    /*don't resolve*/
-+#endif
-+          resmask = NULL;
-+          error = getaddrinfo(s, NULL, &hints, &resmask);
-+          if (error || !resmask) {
-+              if (resmask)
-+                  freeaddrinfo(resmask);
-               a->type = T_FAIL;
-               return "syntax error in mask portion of network/netmask";
-           }
--      }
--      else {
--          /* assume it's in /nnn form */
--          mask = atoi(s);
--          if (mask > 32 || mask <= 0) {
--              a->type = T_FAIL;
--              return "invalid mask in network/netmask";
--          }
--          mask = 0xFFFFFFFFUL << (32 - mask);
--          mask = htonl(mask);
--      }
--      a->x.ip.mask = mask;
--        a->x.ip.net  = (a->x.ip.net & mask);   /* pjr - This fixes PR 4770 */
--    }
--    else if (ap_isdigit(*where) && is_ip(where)) {
--      /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
--      int shift;
--      char *t;
--      int octet;
--
--      a->type = T_IP;
--      /* parse components */
--      s = where;
--      a->x.ip.net = 0;
--      a->x.ip.mask = 0;
--      shift = 24;
--      while (*s) {
--          t = s;
--          if (!ap_isdigit(*t)) {
-+          if (resmask->ai_next) {
-+              freeaddrinfo(resmask);
-               a->type = T_FAIL;
--              return "invalid ip address";
-+              return "network/netmask resolved to multiple addresses";
-           }
--          while (ap_isdigit(*t)) {
--              ++t;
--          }
--          if (*t == '.') {
--              *t++ = 0;
--          }
--          else if (*t) {
-+          memcpy(&mask, resmask->ai_addr, resmask->ai_addrlen);
-+          freeaddrinfo(resmask);
-+
-+          if (net.ss_family != mask.ss_family) {
-               a->type = T_FAIL;
--              return "invalid ip address";
-+              return "network/netmask resolved to different address family";
-           }
--          if (shift < 0) {
--              return "invalid ip address, only 4 octets allowed";
-+
-+          switch (a->type) {
-+          case T_IP:
-+              a->x.ip.mask.s_addr =
-+                  ((struct sockaddr_in *)&mask)->sin_addr.s_addr;
-+              break;
-+#ifdef INET6
-+          case T_IP6:
-+              memcpy(&a->x.ip6.mask6,
-+                  &((struct sockaddr_in6 *)&mask)->sin6_addr,
-+                  sizeof(a->x.ip6.mask6));
-+              break;
-+#endif
-           }
--          octet = atoi(s);
--          if (octet < 0 || octet > 255) {
--              a->type = T_FAIL;
--              return "each octet must be between 0 and 255 inclusive";
-+      } else {
-+          int mask;
-+          mask = atoi(s);
-+          switch (a->type) {
-+          case T_IP:
-+              if (mask < 0 || 32 < mask) {
-+                  a->type = T_FAIL;
-+                  return "netmask out of range";
-+              }
-+              a->x.ip.mask.s_addr = htonl(0xFFFFFFFFUL << (32 - mask));
-+              break;
-+#ifdef INET6
-+          case T_IP6:
-+            {
-+              int i;
-+              if (mask < 0 || 128 < mask) {
-+                  a->type = T_FAIL;
-+                  return "netmask out of range";
-+              }
-+              for (i = 0; i < mask / 8; i++) {
-+                  a->x.ip6.mask6.s6_addr[i] = 0xff;
-+              }
-+              if (mask % 8)
-+                  a->x.ip6.mask6.s6_addr[i] = 0xff << (8 - (mask % 8));
-+              break;
-+            }
-+#endif
-           }
--          a->x.ip.net |= octet << shift;
--          a->x.ip.mask |= 0xFFUL << shift;
--          s = t;
--          shift -= 8;
-       }
--      a->x.ip.net = ntohl(a->x.ip.net);
--      a->x.ip.mask = ntohl(a->x.ip.mask);
-     }
-     else {
--      a->type = T_HOST;
-+      struct addrinfo hints, *res;
-+      struct sockaddr_storage ss;
-+      int error;
-+
-+      a->type = T_FAIL;       /*just in case*/
-+
-+      /* First, try using the old apache code to match */
-+      /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
-+      if (ap_isdigit(*where) && is_ip(where)) {
-+          int shift;
-+          char *t;
-+          int octet;
-+
-+          a->type = T_IP;
-+          /* parse components */
-+          s = where;
-+          a->x.ip.net.s_addr = 0;
-+          a->x.ip.mask.s_addr = 0;
-+          shift = 24;
-+          while (*s) {
-+              t = s;
-+              if (!ap_isdigit(*t)) {
-+                  a->type = T_FAIL;
-+                  return "invalid ip address";
-+              }
-+              while (ap_isdigit(*t)) {
-+                  ++t;
-+              }
-+              if (*t == '.') {
-+                  *t++ = 0;
-+              }
-+              else if (*t) {
-+                  a->type = T_FAIL;
-+                  return "invalid ip address";
-+              }
-+              if (shift < 0) {
-+                  return "invalid ip address, only 4 octets allowed";
-+              }
-+              octet = atoi(s);
-+              if (octet < 0 || octet > 255) {
-+                  a->type = T_FAIL;
-+                  return "each octet must be between 0 and 255 inclusive";
-+              }
-+              a->x.ip.net.s_addr |= octet << shift;
-+              a->x.ip.mask.s_addr |= 0xFFUL << shift;
-+              s = t;
-+              shift -= 8;
-+          }
-+          a->x.ip.net.s_addr = ntohl(a->x.ip.net.s_addr);
-+          a->x.ip.mask.s_addr = ntohl(a->x.ip.mask.s_addr);
-+
-+          return NULL;
-+      }
-+
-+      /* IPv4/v6 numeric address */
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_socktype = SOCK_STREAM;        /*dummy*/
-+#ifdef AI_NUMERICHOST
-+      hints.ai_flags = AI_NUMERICHOST;        /*don't resolve*/
-+#endif
-+      res = NULL;
-+      error = getaddrinfo(where, NULL, &hints, &res);
-+      if (error || !res) {
-+          if (res)
-+              freeaddrinfo(res);
-+          a->type = T_HOST;
-+          return NULL;
-+      }
-+      if (res->ai_next) {
-+          freeaddrinfo(res);
-+          a->type = T_FAIL;
-+          return "network/netmask resolved to multiple addresses";
-+      }
-+      memcpy(&ss, res->ai_addr, res->ai_addrlen);
-+      freeaddrinfo(res);
-+
-+      switch (ss.ss_family) {
-+      case AF_INET:
-+          a->type = T_IP;
-+          a->x.ip.net.s_addr = ((struct sockaddr_in *)&ss)->sin_addr.s_addr;
-+          memset(&a->x.ip.mask, 0xff, sizeof(a->x.ip.mask));
-+          break;
-+#ifdef INET6
-+      case AF_INET6:
-+          a->type = T_IP6;
-+          memcpy(&a->x.ip6.net6, &((struct sockaddr_in6 *)&ss)->sin6_addr,
-+              sizeof(a->x.ip6.net6));
-+          memset(&a->x.ip6.mask6, 0xff, sizeof(a->x.ip6.mask6));
-+          break;
-+#endif
-+      default:
-+          a->type = T_FAIL;
-+          return "unknown address family for network";
-+      }
-     }
-     return NULL;
-@@ -315,12 +464,63 @@
-           return 1;
-       case T_IP:
--          if (ap[i].x.ip.net != INADDR_NONE
--              && (r->connection->remote_addr.sin_addr.s_addr
--                  & ap[i].x.ip.mask) == ap[i].x.ip.net) {
--              return 1;
-+          if (ap[i].x.ip.net.s_addr == INADDR_NONE)
-+              break;
-+          switch (r->connection->remote_addr.ss_family) {
-+          case AF_INET:
-+              if ((((struct sockaddr_in *)&r->connection->remote_addr)->sin_addr.s_addr
-+                      & ap[i].x.ip.mask.s_addr) == ap[i].x.ip.net.s_addr) {
-+                  return 1;
-+              }
-+              break;
-+#ifdef INET6
-+          case AF_INET6:
-+              if (!IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&r->connection->remote_addr)->sin6_addr))    /*XXX*/
-+                  break;
-+              if ((*(ap_uint32_t *)&((struct sockaddr_in6 *)&r->connection->remote_addr)->sin6_addr.s6_addr[12]
-+                      & ap[i].x.ip.mask.s_addr) == ap[i].x.ip.net.s_addr) {
-+                  return 1;
-+              }
-+              break;
-+#endif
-+          }
-+          break;
-+
-+#ifdef INET6
-+      case T_IP6:
-+        {
-+          struct in6_addr masked;
-+          int j;
-+          if (IN6_IS_ADDR_UNSPECIFIED(&ap[i].x.ip6.net6))
-+              break;
-+          switch (r->connection->remote_addr.ss_family) {
-+          case AF_INET:
-+              if (!IN6_IS_ADDR_V4MAPPED(&ap[i].x.ip6.net6))   /*XXX*/
-+                  break;
-+              memset(&masked, 0, sizeof(masked));
-+              masked.s6_addr[10] = masked.s6_addr[11] = 0xff;
-+              memcpy(&masked.s6_addr[12],
-+                  &((struct sockaddr_in *)&r->connection->remote_addr)->sin_addr.s_addr,
-+                  sizeof(struct sockaddr_in));
-+              for (j = 0; j < sizeof(struct in6_addr); j++)
-+                      masked.s6_addr[j] &= ap[i].x.ip6.mask6.s6_addr[j];
-+              if (memcmp(&masked, &ap[i].x.ip6.net6, sizeof(masked)) == 0)
-+                  return 1;
-+              break;
-+          case AF_INET6:
-+              memset(&masked, 0, sizeof(masked));
-+              memcpy(&masked,
-+                  &((struct sockaddr_in6 *)&r->connection->remote_addr)->sin6_addr,
-+                  sizeof(masked));
-+              for (j = 0; j < sizeof(struct in6_addr); j++)
-+                  masked.s6_addr[j] &= ap[i].x.ip6.mask6.s6_addr[j];
-+              if (memcmp(&masked, &ap[i].x.ip6.net6, sizeof(masked)) == 0)
-+                  return 1;
-+              break;
-           }
-           break;
-+        }
-+#endif
-       case T_HOST:
-           if (!gothost) {
-diff -Nur apache_1.3.26.orig/src/modules/standard/mod_unique_id.c apache_1.3.26/src/modules/standard/mod_unique_id.c
---- apache_1.3.26.orig/src/modules/standard/mod_unique_id.c    Wed Mar 13 22:05:34 2002
-+++ apache_1.3.26/src/modules/standard/mod_unique_id.c Wed Jun 19 10:26:32 2002
-@@ -67,10 +67,22 @@
- #include "http_config.h"
- #include "http_log.h"
- #include "multithread.h"
-+#include "sa_len.h"
-+
-+/*#define SHORT_UNIQUE_ID*/
- typedef struct {
-     unsigned int stamp;
--    unsigned int in_addr;
-+    union {
-+      struct in_addr in;
-+#ifdef INET6
-+# ifdef SHORT_UNIQUE_ID
-+      ap_uint32_t in6;
-+# else
-+      struct in6_addr in6;
-+# endif
-+#endif
-+    } addr;
-     unsigned int pid;
- #ifdef MULTITHREAD
-     unsigned int tid;
-@@ -142,7 +154,7 @@
-  * this shouldn't be a problem till year 2106.
-  */
--static unsigned global_in_addr;
-+static struct sockaddr_storage global_addr;
- #ifdef WIN32
-@@ -221,7 +233,8 @@
- #define MAXHOSTNAMELEN 256
- #endif
-     char str[MAXHOSTNAMELEN + 1];
--    struct hostent *hent;
-+    struct addrinfo hints, *res, *res0;
-+    int error;
- #ifndef NO_GETTIMEOFDAY
-     struct timeval tv;
- #endif
-@@ -232,8 +245,8 @@
-      */
-     unique_id_rec_offset[0] = XtOffsetOf(unique_id_rec, stamp);
-     unique_id_rec_size[0] = sizeof(cur_unique_id->stamp);
--    unique_id_rec_offset[1] = XtOffsetOf(unique_id_rec, in_addr);
--    unique_id_rec_size[1] = sizeof(cur_unique_id->in_addr);
-+    unique_id_rec_offset[1] = XtOffsetOf(unique_id_rec, addr);
-+    unique_id_rec_size[1] = sizeof(cur_unique_id->addr);
-     unique_id_rec_offset[2] = XtOffsetOf(unique_id_rec, pid);
-     unique_id_rec_size[2] = sizeof(cur_unique_id->pid);
- #ifdef MULTITHREAD
-@@ -269,17 +282,44 @@
-     }
-     str[sizeof(str) - 1] = '\0';
--    if ((hent = gethostbyname(str)) == NULL) {
-+    memset(&hints, 0, sizeof(hints));
-+    hints.ai_family = PF_UNSPEC;
-+    error = getaddrinfo(str, NULL, &hints, &res0);
-+    if (error) {
-         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s,
--                   "mod_unique_id: unable to gethostbyname(\"%s\")", str);
-+                     "mod_unique_id: getaddrinfo failed for \"%s\" (%s)", str,
-+                   gai_strerror(error));
-         exit(1);
-     }
--    global_in_addr = ((struct in_addr *) hent->h_addr_list[0])->s_addr;
-+    error = 1;
-+    for (res = res0; res; res = res->ai_next) {
-+      switch (res->ai_family) {
-+      case AF_INET:
-+#ifdef INET6
-+      case AF_INET6:
-+#endif
-+          memcpy(&global_addr, res->ai_addr, res->ai_addrlen);
-+          error = 0;
-+          break;
-+      }
-+    }
-+    freeaddrinfo(res0);
-+    if (error) {
-+        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s,
-+                    "mod_unique_id: no known AF found for \"%s\"", str);
-+        exit(1);
-+    }
-+    getnameinfo((struct sockaddr *)&global_addr,
-+#ifndef SIN6_LEN
-+      SA_LEN((struct sockaddr *)&global_addr),
-+#else
-+      global_addr.ss_len,
-+#endif
-+      str, sizeof(str), NULL, 0, NI_NUMERICHOST);
-     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, s,
--               "mod_unique_id: using ip addr %s",
--               inet_ntoa(*(struct in_addr *) hent->h_addr_list[0]));
-+                 "mod_unique_id: using ip addr %s", str);
-     /*
-      * If the server is pummelled with restart requests we could possibly end
-@@ -336,7 +376,23 @@
-                    "oh no! pids are greater than 32-bits!  I'm broken!");
-     }
--    cur_unique_id->in_addr = global_in_addr;
-+    memset(&cur_unique_id->addr, 0, sizeof(cur_unique_id->addr));
-+    switch (global_addr.ss_family) {
-+    case AF_INET:
-+      cur_unique_id->addr.in = ((struct sockaddr_in *)&global_addr)->sin_addr;
-+      break;
-+#ifdef INET6
-+    case AF_INET6:
-+#ifdef SHORT_UNIQUE_ID
-+      cur_unique_id->addr.in6 =
-+          ((struct sockaddr_in6 *)&global_addr)->sin6_addr.s6_addr32[3];
-+#else
-+      cur_unique_id->addr.in6 =
-+          ((struct sockaddr_in6 *)&global_addr)->sin6_addr;
-+#endif
-+      break;
-+#endif
-+    }
-     /*
-      * If we use 0 as the initial counter we have a little less protection
-diff -Nur apache_1.3.26.orig/src/support/ab.c apache_1.3.26/src/support/ab.c
---- apache_1.3.26.orig/src/support/ab.c        Sat May 11 22:47:57 2002
-+++ apache_1.3.26/src/support/ab.c     Wed Jun 19 11:08:58 2002
-@@ -158,6 +158,8 @@
- #include <sys/uio.h>
- #endif
-+#include "sa_len.h"
-+
- #endif                                /* NO_APACHE_INCLUDES */
- #ifdef        USE_SSL
-@@ -246,7 +248,7 @@
- char servername[1024];                /* name that server reports */
- char hostname[1024];          /* host name */
- char proxyhost[1024];         /* proxy host name */
--int proxyport = 0;            /* proxy port */
-+char *proxyport = NULL;               /* proxy port */
- int isproxy = 0;
- char path[1024];              /* path name */
- char postfile[1024];          /* name of file containing post data */
-@@ -262,7 +264,7 @@
-      auth[1024],              /* optional (basic/uuencoded)
-                                * authentification */
-      hdrs[4096];              /* optional arbitrary headers */
--int port = 80;                        /* port number */
-+char *port = "80";            /* port number */
- int use_html = 0;             /* use html in the report */
- char *tablestring;
-@@ -299,7 +301,7 @@
- struct data *stats;           /* date for each request */
- fd_set readbits, writebits;   /* bits for select */
--struct sockaddr_in server;    /* server addr structure */
-+struct sockaddr_storage server;      /* server addr structure */
- #ifndef BEOS
- #define ab_close(s) close(s)
-@@ -525,7 +527,7 @@
-     printf("\r                                                                           \r");
-     printf("Server Software:        %s\n", servername);
-     printf("Server Hostname:        %s\n", hostname);
--    printf("Server Port:            %d\n", port);
-+    printf("Server Port:            %s\n", port);
-     printf("\n");
-     printf("Document Path:          %s\n", path);
-     printf("Document Length:        %d bytes\n", doclen);
-@@ -878,7 +880,7 @@
-     c->cbx = 0;
-     c->gotheader = 0;
--    c->fd = socket(AF_INET, SOCK_STREAM, 0);
-+    c->fd = socket(server.ss_family, SOCK_STREAM, 0);
-     if (c->fd < 0) {
-       what = "SOCKET";
-       goto _bad;
-@@ -895,7 +897,12 @@
- again:
-     gettimeofday(&c->start, 0);
--    if (connect(c->fd, (struct sockaddr *) & server, sizeof(server)) < 0) {
-+#ifndef SIN6_LEN
-+    if (connect(c->fd, (struct sockaddr *) & server, SA_LEN((struct sockaddr*)&server)) < 0)
-+#else
-+    if (connect(c->fd, (struct sockaddr *) & server, server.ss_len) < 0)
-+#endif
-+    {
-       if (errno != EINPROGRESS) {
-           what = "CONNECT";
-           goto _bad;
-@@ -1182,7 +1189,7 @@
-     struct timeval timeout, now;
-     fd_set sel_read, sel_except, sel_write;
-     long i;
--    int connectport;
-+    char * connectport;
-     char * connecthost;
-     char * url_on_request;
-@@ -1225,17 +1232,21 @@
-     }
-     {
-       /* get server information */
--      struct hostent *he;
--      he = gethostbyname(connecthost);
--      if (!he) {
--          char theerror[1024];
--          ap_snprintf(theerror, sizeof(theerror),
--                        "Bad hostname: %s\n", connecthost);
--          err(theerror);
--      }
--      server.sin_family = he->h_addrtype;
--      server.sin_port = htons(connectport);
--      server.sin_addr.s_addr = ((unsigned long *) (he->h_addr_list[0]))[0];
-+      struct addrinfo hints, *res;
-+      int error;
-+
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      hints.ai_socktype = SOCK_STREAM;
-+      error = getaddrinfo(connecthost, connectport, &hints, &res);
-+      if (error) {
-+              char *theerror=malloc(strlen(connecthost)+16);
-+              sprintf(theerror, "Bad hostname: %s\n", connecthost);
-+              err(theerror);
-+              free(theerror);
-+      }
-+      memcpy(&server, res->ai_addr, res->ai_addrlen);
-+      freeaddrinfo(res);
-     }
-     con = malloc(concurrency * sizeof(struct connection));
-@@ -1423,7 +1434,7 @@
-     if (strlen(purl) > 8 && strncmp(purl, "https://", 8) == 0) {
-       purl += 8;
-       ssl = 1;
--      port = 443;
-+      port = "443";
-     }
- #else
-     if (strlen(purl) > 8 && strncmp(purl, "https://", 8) == 0) {
-@@ -1444,15 +1455,15 @@
-     *cp = '\0';
-     strcpy(hostname, h);
-     if (p != NULL)
--      port = atoi(p);
-+      port = strdup(p);
-     if ((
- #ifdef USE_SSL
--      (ssl != 0) && (port != 443)) || ((ssl == 0) && 
-+      (ssl != 0) && (strcmp(port, "443"))) || ((ssl == 0) && 
- #endif
--      (port != 80))) 
-+      (strcmp(port, "80")))) 
-    {
--      ap_snprintf(colonport,sizeof(colonport),":%d",port);
-+      ap_snprintf(colonport,sizeof(colonport),":%s",port);
-    } else {
-       colonport[0] = '\0';
-    }
-@@ -1615,7 +1626,7 @@
-               if ((p = strchr(optarg, ':'))) {
-                   *p = '\0';
-                   p++;
--                  proxyport = atoi(p);
-+                  proxyport = strdup(p);
-               };
-               strcpy(proxyhost, optarg);
-               isproxy = 1;
-@@ -1698,3 +1709,7 @@
-     exit(0);
- }
-+
-+#ifdef NEED_GETADDRINFO
-+#include "../main/getaddrinfo.c"
-+#endif
-diff -Nur apache_1.3.26.orig/src/support/logresolve.c apache_1.3.26/src/support/logresolve.c
---- apache_1.3.26.orig/src/support/logresolve.c        Wed May 23 00:52:21 2001
-+++ apache_1.3.26/src/support/logresolve.c     Wed Jun 19 10:26:32 2002
-@@ -54,7 +54,9 @@
- #endif /* BEOS */
- #endif /* !MPE && !WIN32*/
--static void cgethost(struct in_addr ipnum, char *string, int check);
-+#include "sa_len.h"
-+
-+static void cgethost(struct sockaddr *sa, char *string, int check);
- static int getline(char *s, int n);
- static void stats(FILE *output);
-@@ -91,7 +93,7 @@
-  */
- struct nsrec {
--    struct in_addr ipnum;
-+    struct sockaddr_storage addr;
-     char *hostname;
-     int noname;
-     struct nsrec *next;
-@@ -122,17 +124,48 @@
-  * IP numbers with their IP number as hostname, setting noname flag
-  */
--static void cgethost (struct in_addr ipnum, char *string, int check)
-+static void cgethost (struct sockaddr *sa, char *string, int check)
- {
-+    ap_uint32_t hashval;
-+    struct sockaddr_in *sin;
-+#ifdef INET6
-+    struct sockaddr_in6 *sin6;
-+#endif
-     struct nsrec **current, *new;
--    struct hostent *hostdata;
-     char *name;
-+    char hostnamebuf[MAXHOSTNAMELEN];
-+
-+    switch (sa->sa_family) {
-+    case AF_INET:
-+      hashval = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
-+      break;
-+#ifdef INET6
-+    case AF_INET6:
-+      hashval = *(ap_uint32_t *)&((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[12];
-+      break;
-+#endif
-+    default:
-+      hashval = 0;
-+      break;
-+    }
-+
-+    current = &nscache[((hashval + (hashval >> 8) +
-+                       (hashval >> 16) + (hashval >> 24)) % BUCKETS)];
--    current = &nscache[((ipnum.s_addr + (ipnum.s_addr >> 8) +
--                       (ipnum.s_addr >> 16) + (ipnum.s_addr >> 24)) % BUCKETS)];
-+    while (*current) {
-+#ifndef SIN6_LEN
-+      if (SA_LEN(sa) == SA_LEN((struct sockaddr *)&(*current)->addr)
-+       && memcmp(sa, &(*current)->addr, SA_LEN(sa)) == 0)
-+#else
-+      if (sa->sa_len == (*current)->addr.ss_len
-+       && memcmp(sa, &(*current)->addr, sa->sa_len) == 0)
-+#endif
-+      {
-+          break;
-+      }
--    while (*current != NULL && ipnum.s_addr != (*current)->ipnum.s_addr)
-       current = &(*current)->next;
-+    }
-     if (*current == NULL) {
-       cachesize++;
-@@ -145,45 +178,55 @@
-       *current = new;
-       new->next = NULL;
--      new->ipnum = ipnum;
-+#ifndef SIN6_LEN
-+      memcpy(&new->addr, sa, SA_LEN(sa));
-+#else
-+      memcpy(&new->addr, sa, sa->sa_len);
-+#endif
--      hostdata = gethostbyaddr((const char *) &ipnum, sizeof(struct in_addr),
--                               AF_INET);
--      if (hostdata == NULL) {
--          if (h_errno > MAX_ERR)
--              errors[UNKNOWN_ERR]++;
--          else
--              errors[h_errno]++;
--          new->noname = h_errno;
--          name = strdup(inet_ntoa(ipnum));
--      }
--      else {
--          new->noname = 0;
--          name = strdup(hostdata->h_name);
--          if (check) {
--              if (name == NULL) {
--                  perror("strdup");
--                  fprintf(stderr, "Insufficient memory\n");
--                  exit(1);
--              }
--              hostdata = gethostbyname(name);
--              if (hostdata != NULL) {
--                  char **hptr;
--
--                  for (hptr = hostdata->h_addr_list; *hptr != NULL; hptr++)
--                      if (((struct in_addr *) (*hptr))->s_addr == ipnum.s_addr)
--                          break;
--                  if (*hptr == NULL)
--                      hostdata = NULL;
--              }
--              if (hostdata == NULL) {
--                  fprintf(stderr, "Bad host: %s != %s\n", name,
--                          inet_ntoa(ipnum));
--                  new->noname = NO_REVERSE;
--                  free(name);
--                  name = strdup(inet_ntoa(ipnum));
--                  errors[NO_REVERSE]++;
-+      new->noname = getnameinfo(sa,
-+#ifndef SIN6_LEN
-+              SA_LEN(sa),
-+#else
-+              sa->sa_len,
-+#endif
-+                  hostnamebuf, sizeof(hostnamebuf), NULL, 0, 0);
-+      name = strdup(hostnamebuf);
-+      if (check) {
-+          struct addrinfo hints, *res;
-+          int error;
-+          memset(&hints, 0, sizeof(hints));
-+          hints.ai_family = PF_UNSPEC;
-+          error = getaddrinfo(hostnamebuf, NULL, &hints, &res);
-+          if (!error) {
-+              while (res) {
-+#ifndef SIN6_LEN
-+                  if (SA_LEN(sa) == res->ai_addrlen
-+                   && memcmp(sa, res->ai_addr, SA_LEN(sa)) == 0)
-+#else
-+                  if (sa->sa_len == res->ai_addrlen
-+                   && memcmp(sa, res->ai_addr, sa->sa_len) == 0)
-+#endif
-+                  {
-+                      break;
-+                  }
-+                  res = res->ai_next;
-               }
-+              if (!res)
-+                  error++;
-+          }
-+          if (error) {
-+              getnameinfo(sa,
-+#ifndef SIN6_LEN
-+                  SA_LEN(sa),
-+#else
-+                  sa->sa_len,
-+#endif
-+                  hostnamebuf, sizeof(hostnamebuf), NULL, 0, NI_NUMERICHOST);
-+              fprintf(stderr, "Bad host: %s != %s\n", name, hostnamebuf);
-+              new->noname = NO_REVERSE;
-+              free(name);
-+              name = strdup(hostnamebuf);
-           }
-       }
-       new->hostname = name;
-@@ -211,6 +254,7 @@
-     char *ipstring;
-     struct nsrec *current;
-     char *errstring[MAX_ERR + 3];
-+    char hostnamebuf[MAXHOSTNAMELEN];
-     for (i = 0; i < MAX_ERR + 3; i++)
-       errstring[i] = "Unknown error";
-@@ -242,7 +286,14 @@
-     for (i = 0; i < BUCKETS; i++)
-       for (current = nscache[i]; current != NULL; current = current->next) {
--          ipstring = inet_ntoa(current->ipnum);
-+          getnameinfo((struct sockaddr *)&current->addr,
-+#ifndef SIN6_LEN
-+                  SA_LEN((struct sockaddr *)&current->addr),
-+#else
-+                  current->addr.ss_len,
-+#endif
-+                  hostnamebuf, sizeof(hostnamebuf), NULL, 0, NI_NUMERICHOST);
-+          ipstring = hostnamebuf;
-           if (current->noname == 0)
-               fprintf(output, "  %3d  %15s - %s\n", i, ipstring,
-                       current->hostname);
-@@ -276,9 +327,10 @@
- int main (int argc, char *argv[])
- {
--    struct in_addr ipnum;
-     char *bar, hoststring[MAXDNAME + 1], line[MAXLINE], *statfile;
-     int i, check;
-+    struct addrinfo hints, *res;
-+    int error;
- #ifdef WIN32
-     WSADATA wsaData;
-@@ -322,8 +374,10 @@
-       bar = strchr(line, ' ');
-       if (bar != NULL)
-           *bar = '\0';
--      ipnum.s_addr = inet_addr(line);
--      if (ipnum.s_addr == 0xffffffffu) {
-+      memset(&hints, 0, sizeof(hints));
-+      hints.ai_family = PF_UNSPEC;
-+      error = getaddrinfo(line, NULL, &hints, &res);
-+      if (error) {
-           if (bar != NULL)
-               *bar = ' ';
-           puts(line);
-@@ -333,11 +387,12 @@
-       resolves++;
--      cgethost(ipnum, hoststring, check);
-+      cgethost(res->ai_addr, hoststring, check);
-       if (bar != NULL)
-           printf("%s %s\n", hoststring, bar + 1);
-       else
-           puts(hoststring);
-+      freeaddrinfo(res);
-     }
- #ifdef WIN32
-@@ -358,3 +413,11 @@
-     return (0);
- }
-+
-+#ifdef NEED_GETADDRINFO
-+#include "../main/getaddrinfo.c"
-+#endif
-+
-+#ifdef NEED_GETNAMEINFO
-+#include "../main/getnameinfo.c"
-+#endif
diff --git a/apache-lookup_map_ldap.patch b/apache-lookup_map_ldap.patch
deleted file mode 100644 (file)
index e4676a5..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
---- apache_1.3.12/src/modules/standard/mod_rewrite.c.wiget     Wed Aug 23 17:32:28 2000
-+++ apache_1.3.12/src/modules/standard/mod_rewrite.c   Wed Aug 23 18:33:51 2000
-@@ -98,6 +98,9 @@
- #include <sys/uio.h>
- #endif
-+#include <stdlib.h>
-+#include <stdio.h>
-+
- /*
- ** +-------------------------------------------------------+
- ** |                                                       |
-@@ -151,6 +154,14 @@
-         echo "      (perhaps you need to add -ldbm, -lndbm or -lgdbm to EXTRA_LIBS)"
-         CFLAGS="$CFLAGS -DNO_DBM_REWRITEMAP"
-     fi
-+    . ./helpers/find-ldap-lib
-+    if [ "x$found_ldap" = "x1" ]; then
-+      echo "      enabling LDAP support for mod_rewrite"
-+    else
-+      echo "      disabling LDAP support for mod_rewrite"
-+      echo "      (perhaps you need to add -llber -lldap to EXTRA_LIBS)"
-+      CFLAGS="$CFLAGS -DNO_LDAP_REWRITEMAP"
-+    fi
-      * ConfigEnd
-      * MODULE-DEFINITION-END
-      */
-@@ -480,6 +491,16 @@
-                           "because no NDBM support is compiled in");
- #endif
-     }
-+    else if (strncmp(a2, "ldap:", 4) == 0) {
-+#ifndef NO_LDAP_REWRITEMAP
-+        new->type      = MAPTYPE_LDAP;
-+        new->datafile  = a2;
-+/*        new->checkfile = ap_pstrcat(cmd->pool, a2+5, LDAP_FILE_SUFFIX, NULL); */
-+#else
-+        return ap_pstrdup(cmd->pool, "RewriteMap: cannot use LDAP mapfile, "
-+                          "because no LDAP support is compiled in");
-+#endif
-+    }
-     else if (strncmp(a2, "prg:", 4) == 0) {
-         new->type = MAPTYPE_PRG;
-         new->datafile = a2+4;
-@@ -2792,6 +2813,48 @@
-                 return NULL;
- #endif
-             }
-+            else if (s->type == MAPTYPE_LDAP) {
-+#ifndef NO_LDAP_REWRITEMAP
-+/* FIXME */               
-+/*                if (stat(s->checkfile, &st) == -1) {
-+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-+                                 "mod_rewrite: can't access LDAP RewriteMap "
-+                                 "file %s", s->checkfile);
-+                    rewritelog(r, 1, "can't open LDAP RewriteMap file, "
-+                               "see error log");
-+                    return NULL;
-+                } */
-+              rewritelog(r, 1, "MAPTYPE_LDAP: ok ");
-+                value = get_cache_string(cachep, s->name, CACHEMODE_TS,
-+                                         st.st_mtime, key);
-+                if (value == NULL) {
-+                    rewritelog(r, 6,
-+                               "cache lookup FAILED, forcing new map lookup");
-+                    if ((value =
-+                         lookup_map_ldap(r, s->datafile, key)) != NULL) {
-+                        rewritelog(r, 5, "map lookup OK: map=%s[ldap] key=%s "
-+                                   "-> val=%s", s->name, key, value);
-+                        set_cache_string(cachep, s->name, CACHEMODE_TS,
-+                                         st.st_mtime, key, value);
-+                        return value;
-+                    }
-+                    else {
-+                        rewritelog(r, 5, "map lookup FAILED: map=%s[ldap] "
-+                                   "key=%s", s->name, key);
-+                        set_cache_string(cachep, s->name, CACHEMODE_TS,
-+                                         st.st_mtime, key, "");
-+                        return NULL;
-+                    }
-+                }
-+                else {
-+                    rewritelog(r, 5, "cache lookup OK: map=%s[ldap] key=%s "
-+                               "-> val=%s", s->name, key, value);
-+                    return value[0] != '\0' ? value : NULL;
-+                }
-+#else
-+                return NULL;
-+#endif
-+            }
-             else if (s->type == MAPTYPE_PRG) {
-                 if ((value =
-                      lookup_map_program(r, s->fpin, s->fpout, key)) != NULL) {
-@@ -2929,6 +2992,71 @@
-         dbm_close(dbmfp);
-     }
-     return value;
-+}
-+#endif
-+
-+#ifndef NO_LDAP_REWRITEMAP
-+/* FIXME */
-+static char *lookup_map_ldap(request_rec *r, char *url, char *key)
-+{
-+#define       LDAP_URL_MAX    512
-+  LDAP *ld;
-+  LDAPMessage *msg, *entry;
-+  char **temp;
-+  int res;
-+  char *url_p;
-+  
-+  url_p = (char *)malloc((size_t)LDAP_URL_MAX);
-+  snprintf(url_p, LDAP_URL_MAX, url, key);
-+  ld=ldap_open("localhost", 389);
-+
-+  if (!ld)
-+    return NULL;
-+  
-+    res = ldap_simple_bind_s(ld,NULL,NULL);
-+  if (res!=LDAP_SUCCESS) {
-+    ldap_unbind(ld);
-+    return NULL; 
-+  }
-+  
-+/*     
-+       int ldap_url_search_s( ld, url, attrsonly, res )
-+       LDAP      *ld;
-+       char      *url;
-+       int       attrsonly;
-+       LDAPMessage    **res;
-+
-+       char *ldap_first_attribute(ld, entry, berptr)
-+       LDAP *ld;
-+       LDAPMessage *entry;
-+       BerElement **berptr;
-+       
-+*/
-+
-+    res = ldap_url_search_s(ld, url_p, 0, &msg );
-+    free(url_p);
-+    if ((res!=LDAP_SUCCESS) || !msg)
-+    {
-+/*        ldap_perror(ld,"lookup_map_ldap"); */
-+      ldap_unbind(ld);
-+      return NULL;
-+    }
-+    entry = ldap_first_entry(ld, msg);
-+    if (!entry) {
-+          ldap_msgfree(msg);
-+          return NULL;
-+    }
-+    
-+  temp = ldap_get_values(ld, entry, "homedirectory");
-+  if (! temp) {
-+    return NULL;
-+  }
-+
-+  /* Assumes that the above ldap_get_values call only returns 1 value */
-+/*  strncpy(value, temp[0], (size_t)MAX_PATH); */
-+          
-+/*    return (char *)value; */
-+  return temp[0];
- }
- #endif
---- apache_1.3.12/src/modules/standard/mod_rewrite.h.wiget     Thu Oct 21 22:45:38 1999
-+++ apache_1.3.12/src/modules/standard/mod_rewrite.h   Mon Jun  5 21:11:11 2000
-@@ -179,6 +179,11 @@
- #include <sys/locking.h>
- #endif
-+#ifndef NO_LDAP_REWRITEMAP
-+#include <lber.h>    
-+#include <ldap.h>    
-+#endif
-+    
- /*
- **
-@@ -219,6 +224,7 @@
- #define MAPTYPE_PRG                 1<<2
- #define MAPTYPE_INT                 1<<3
- #define MAPTYPE_RND                 1<<4
-+#define MAPTYPE_LDAP                1<<5
- #define ENGINE_DISABLED             1<<0
- #define ENGINE_ENABLED              1<<1
-@@ -434,6 +440,9 @@
- static char *lookup_map_txtfile(request_rec *r, char *file, char *key);
- #ifndef NO_DBM_REWRITEMAP
- static char *lookup_map_dbmfile(request_rec *r, char *file, char *key);
-+#endif
-+#ifndef NO_LDAP_REWRITEMAP
-+static char *lookup_map_ldap(request_rec *r, char *url, char *key);
- #endif
- static char *lookup_map_program(request_rec *r, int fpin,
-                                 int fpout, char *key);
---- /dev/null  Tue May  5 22:32:27 1998
-+++ apache_1.3.12/src/helpers/find-ldap-lib    Wed Aug 23 18:32:53 2000
-@@ -0,0 +1,15 @@
-+if [ "x$found_ldap" = "x" ]; then
-+    if ./helpers/TestCompile func ldap_open; then
-+      found_ldap=1
-+    else
-+      found_ldap=0
-+      LDAP_LIB=""
-+      if ./helpers/TestCompile lib "ldap -llber" ldap_open; then
-+          LDAP_LIB="-lldap -llber"
-+              found_ldap=1
-+      fi
-+      if [ "x$found_ldap" = "x1" ]; then
-+          echo " + using $LDAP_LIB for LDAP support"
-+      fi
-+    fi
-+fi
diff --git a/apache-man.patch b/apache-man.patch
deleted file mode 100644 (file)
index 9de24a5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-diff -uNr apache_1.3.10.orig/Makefile.tmpl apache_1.3.10/Makefile.tmpl
---- apache_1.3.10.orig/Makefile.tmpl   Tue Jan 11 20:47:41 2000
-+++ apache_1.3.10/Makefile.tmpl        Tue Jan 18 14:12:31 2000
-@@ -315,7 +315,14 @@
-                       done; \
-               fi; \
-       fi
--      $(INSTALL_DATA) $(TOP)/$(SRC)/support/httpd.8 $(root)$(mandir)/man8/$(TARGET).8
-+      cat $(TOP)/$(SRC)/support/httpd.8 |\
-+                    sed -e 's;@@ServerRoot@@;$(prefix);' \
-+                        -e 's;@@SysconfDir@@;$(sysconfdir);' \
-+                        -e 's;@@LogfileDir@@;$(logfiledir);' \
-+                        -e 's;@@RuntimeDir@@;$(runtimedir);' \
-+                        > $(TOP)/$(SRC)/.apaci.install.tmp
-+      $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp \
-+                        $(root)$(mandir)/man8/$(TARGET).8
-       -@$(RM) $(SRC)/.apaci.install.conf; touch $(SRC)/.apaci.install.conf
-       -@if [ ".`grep '^[      ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci`" != . ]; then \
-               for mod in `egrep '^[   ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci |\
-diff -uNr apache_1.3.10.orig/src/support/httpd.8 apache_1.3.10/src/support/httpd.8
---- apache_1.3.10.orig/src/support/httpd.8     Tue Aug 10 15:54:47 1999
-+++ apache_1.3.10/src/support/httpd.8  Tue Jan 18 14:10:55 2000
-@@ -133,7 +133,7 @@
- .BI \-d " serverroot"
- Set the initial value for the ServerRoot directive to \fIserverroot\fP. This
- can be overridden by the ServerRoot command in the configuration file. The
--default is \fB/usr/local/apache\fP.
-+default is \fB@@ServerRoot@@\fP.
- .TP
- .BI \-f " config"
- Execute the commands in the file \fIconfig\fP on startup. If \fIconfig\fP
-@@ -191,21 +191,21 @@
- , and then exit.
- .SH FILES
- .PD 0
--.B /usr/local/apache/conf/httpd.conf
-+.B @@SysconfDir@@/httpd.conf
- .br
--.B /usr/local/apache/conf/srm.conf
-+.B @@SysconfDir@@/srm.conf
- .br
--.B /usr/local/apache/conf/access.conf
-+.B @@SysconfDir@@/access.conf
- .br
--.B /usr/local/apache/conf/mime.types
-+.B @@SysconfDir@@/mime.types
- .br
--.B /usr/local/apache/conf/magic
-+.B @@SysconfDir@@/magic
- .br
--.B /usr/local/apache/logs/error_log
-+.B @@LogfileDir@@/error_log
- .br
--.B /usr/local/apache/logs/access_log
-+.B @@LogfileDir@@/access_log
- .br
--.B /usr/local/apache/logs/httpd.pid
-+.B @@RuntimeDir@@/httpd.pid
- .PD
- .SH SEE ALSO
- .BR inetd (8).
diff --git a/apache-mkstemp.patch b/apache-mkstemp.patch
deleted file mode 100644 (file)
index 75ce679..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-Greg Kroah-Hartman's patch, dated 8 Jan 2001.
-diff -aur apache_1.3.14/src/support/htdigest.c apache_1.3.14-mkstemp/src/support/htdigest.c
---- apache_1.3.14/src/support/htdigest.c       Tue Jan 25 23:36:53 2000
-+++ apache_1.3.14-mkstemp/src/support/htdigest.c       Tue Jan  9 20:42:42 2001
-@@ -93,7 +93,7 @@
- #define MAX_STRING_LEN 256
--char *tn;
-+char tn[MAX_STRING_LEN];
- static void getword(char *word, char *line, char stop)
-@@ -156,7 +156,7 @@
-     ap_getpass("Re-type new password: ", pwv, sizeof(pwv));
-     if (strcmp(pwin, pwv) != 0) {
-       fprintf(stderr, "They don't match, sorry.\n");
--      if (tn) {
-+      if (strlen(tn)) {
-           unlink(tn);
-       }
-       exit(1);
-@@ -187,7 +187,7 @@
- static void interrupted(void)
- {
-     fprintf(stderr, "Interrupted.\n");
--    if (tn)
-+    if (strlen(tn))
-       unlink(tn);
-     exit(1);
- }
-@@ -215,8 +215,9 @@
-     char x[MAX_STRING_LEN];
-     char command[MAX_STRING_LEN];
-     int found;
-+    int tfd;
--    tn = NULL;
-+    strcpy (tn, "/tmp/htdigest-XXXXXX");
-     signal(SIGINT, (void (*)(int)) interrupted);
-     if (argc == 5) {
-       if (strcmp(argv[1], "-c"))
-@@ -235,8 +236,12 @@
-     else if (argc != 4)
-       usage();
--    tn = tmpnam(NULL);
--    if (!(tfp = fopen(tn, "w"))) {
-+    tfd = mkstemp (tn);
-+    if (tfd == -1) {
-+      fprintf(stderr, "Could not open temp file.\n");
-+      exit(1);
-+    }
-+    if (!(tfp = fdopen(tfd, "w"))) {
-       fprintf(stderr, "Could not open temp file.\n");
-       exit(1);
-     }
-diff -aur apache_1.3.14/src/support/htpasswd.c apache_1.3.14-mkstemp/src/support/htpasswd.c
---- apache_1.3.14/src/support/htpasswd.c       Thu Jun  1 19:42:33 2000
-+++ apache_1.3.14-mkstemp/src/support/htpasswd.c       Tue Jan  9 20:41:36 2001
-@@ -125,7 +125,7 @@
-  * This needs to be declared statically so the signal handler can
-  * access it.
-  */
--static char *tempfilename;
-+static char tempfilename[MAX_STRING_LEN];
- /*
-  * If our platform knows about the tmpnam() external buffer size, create
-  * a buffer to pass in.  This is needed in a threaded environment, or
-@@ -285,7 +285,7 @@
- static void interrupted(void)
- {
-     fprintf(stderr, "Interrupted.\n");
--    if (tempfilename != NULL) {
-+    if (strlen(tempfilename) > 0) {
-       unlink(tempfilename);
-     }
-     exit(ERR_INTERRUPTED);
-@@ -377,8 +377,10 @@
-     int noninteractive = 0;
-     int i;
-     int args_left = 2;
-+    int tfd;
-+
-+    memset (tempfilename, 0x00, sizeof(tempfilename));
--    tempfilename = NULL;
-     signal(SIGINT, (void (*)(int)) interrupted);
-     /*
-@@ -560,8 +562,9 @@
-      * to add or update.  Let's do it..
-      */
-     errno = 0;
--    tempfilename = tmpnam(tname_buf);
--    if ((tempfilename == NULL) || (*tempfilename == '\0')) {
-+    strcpy(tempfilename, "/tmp/htpasswd-XXXXXX");
-+    tfd = mkstemp(tempfilename);
-+    if (tfd == -1) {
-       fprintf(stderr, "%s: unable to generate temporary filename\n",
-               argv[0]);
-       if (errno == 0) {
-@@ -570,7 +573,7 @@
-       perror("tmpnam");
-       exit(ERR_FILEPERM);
-     }
--    ftemp = fopen(tempfilename, "w+");
-+    ftemp = fdopen(tfd, "w+");
-     if (ftemp == NULL) {
-       fprintf(stderr, "%s: unable to create temporary file '%s'\n", argv[0],
-               tempfilename);
diff --git a/apache-mod_ssl-addon.patch b/apache-mod_ssl-addon.patch
deleted file mode 100644 (file)
index 73c1cbc..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-##                      _             _ 
-##  _ __ ___   ___   __| |    ___ ___| |  mod_ssl
-## | '_ ` _ \ / _ \ / _` |   / __/ __| |  Apache Interface to OpenSSL
-## | | | | | | (_) | (_| |   \__ \__ \ |  www.modssl.org
-## |_| |_| |_|\___/ \__,_|___|___/___/_|  ftp.modssl.org
-##                      |_____|         
-## ____________________________________________________________________________
-##
-## Annotated patch file: addon.patch
-## Copyright (c) 1998-2001 Ralf S. Engelschall, All Rights Reserved. 
-## Created on: 04-Oct-2002
-##
-## This file assembles changes to existing Apache source files
-## between the original Apache and the patched variant. It can be
-## automatically applied to a vanilla Apache source tree with the
-## 'patch' tool to upgrade those files.  Each patch snippet is
-## annotated with a short description.
-##
-
-+---------------------------------------------------------------------------
-| Add an entry for mod_define.
-+---------------------------------------------------------------------------
-Index: src/Configuration.tmpl
---- src/Configuration.tmpl     28 Jan 2002 19:21:21 -0000      1.1.1.7
-+++ src/Configuration.tmpl     28 Jan 2002 19:40:56 -0000      1.23
-@@ -258,6 +313,11 @@
- 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
- ##
-
-+---------------------------------------------------------------------------
-| Add more beautiful optic to the status page table..
-+---------------------------------------------------------------------------
-Index: src/modules/standard/mod_status.c
---- src/modules/standard/mod_status.c  27 Mar 2002 15:23:06 -0000      1.1.1.14
-+++ src/modules/standard/mod_status.c  27 Mar 2002 15:30:03 -0000      1.11
-@@ -484,12 +484,33 @@
-           if (no_table_report)
-               ap_rputs("<p><hr><h2>Server Details</h2>\n\n", r);
-           else
-+#ifndef NO_PRETTYPRINT
-+              ap_rputs("<p>\n\n<table bgcolor=\"#ffffff\" border=\"0\">"
-+                      "<tr bgcolor=000000>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Srv</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>PID</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Acc</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>M</b></font></td>"
-+#ifndef NO_TIMES
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>CPU</b></font></td>"
-+#endif
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>SS</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Req</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Conn</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Child</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Slot</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Host</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>VHost</b></font></td>"
-+                      "<td><font face=\"Arial,Helvetica\" color=\"#ffffff\"><b>Request</b></td>"
-+                      "</tr>\n", r);      
-+#else /* NO_PRETTYPRINT */
- #ifdef NO_TIMES
-               /* Allow for OS/2 not having CPU stats */
-               ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
- #else
-               ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M<th>CPU\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
- #endif
-+#endif /* NO_PRETTYPRINT */
-       }
-       for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
-@@ -607,14 +628,19 @@
-                               vhost->server_hostname) : "(unavailable)");
-                   }
-                   else {              /* !no_table_report */
-+#ifndef NO_PRETTYPRINT
-+                      ap_rprintf(r,"<tr bgcolor=\"#ffffff\">");
-+#else
-+                      ap_rprintf(r,"<tr>");
-+#endif
-                       if (score_record.status == SERVER_DEAD)
-                           ap_rprintf(r,
--                              "<tr><td><b>%d-%d</b><td>-<td>%d/%lu/%lu",
-+                              "<td><b>%d-%d</b><td>-<td>%d/%lu/%lu",
-                               i, (int) ps_record.generation,
-                               (int) conn_lres, my_lres, lres);
-                       else
-                           ap_rprintf(r,
--                              "<tr><td><b>%d-%d</b><td>%d<td>%d/%lu/%lu",
-+                              "<td><b>%d-%d</b><td>%d<td>%d/%lu/%lu",
-                               i, (int) ps_record.generation,
-                               (int) ps_record.pid, (int) conn_lres,
-                               my_lres, lres);
-@@ -674,12 +700,23 @@
-                           ap_rprintf(r,
-                            "<td>?<td nowrap>?<td nowrap>..reading.. </tr>\n\n");
-                       else
-+#ifndef NO_PRETTYPRINT
-+                          ap_rprintf(r,
-+                           "<td nowrap><font face=\"Arial,Helvetica\" size=\"-1\">%s</font>"
-+                           "<td nowrap><font face=\"Arial,Helvetica\" size=\"-1\">%s</font>"
-+                           "<td nowrap><font face=\"Arial,Helvetica\" size=\"-1\">%s</font>"
-+                           "</tr>\n\n",
-+                           score_record.client,
-+                           vhost ? vhost->server_hostname : "(unavailable)",
-+                           ap_escape_html(r->pool, score_record.request));
-+#else
-                           ap_rprintf(r,
-                            "<td>%s<td nowrap>%s<td nowrap>%s</tr>\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 (<active child>) */
-
-+---------------------------------------------------------------------------
-| Add a hyperlink to the mod_define.html document.
-+---------------------------------------------------------------------------
-Index: htdocs/manual/mod/index.html.en
---- htdocs/manual/mod/index.html.en    28 Jan 2002 19:21:43 -0000      1.1.1.2
-+++ htdocs/manual/mod/index.html.en    28 Jan 2002 19:40:56 -0000      1.3
-@@ -101,6 +101,10 @@
-       <dd>Support for Netscape-like cookies. Replaced in Apache 1.2
-       by mod_usertrack</dd>
-+      <dt><a href="mod_define.html">mod_define</a></dt>
-+
-+      <dd>Variable Definition for Arbitrary Directives</dd>
-+
-       <dt><a href="mod_digest.html">mod_digest</a> Apache 1.1 and
-       up</dt>
-
-+---------------------------------------------------------------------------
-| Add a hyperlink for the Define directives.
-+---------------------------------------------------------------------------
-Index: htdocs/manual/mod/directives.html.en
---- htdocs/manual/mod/directives.html.en       4 Oct 2002 11:50:01 -0000       1.1.1.4
-+++ htdocs/manual/mod/directives.html.en       4 Oct 2002 11:54:56 -0000       1.5
-@@ -220,6 +220,8 @@
-       <li><a href="core.html#defaulttype">DefaultType</a></li>
-+      <li><a href="mod_define.html#define">Define</a>
-+
-       <li><a href="mod_access.html#deny">Deny</a></li>
-       <li><a href="core.html#directory">&lt;Directory&gt;</a></li>
diff --git a/apache-mod_ssl-eapi.patch b/apache-mod_ssl-eapi.patch
deleted file mode 100644 (file)
index 8a3c33d..0000000
+++ /dev/null
@@ -1,2011 +0,0 @@
-##  _____   _    ____ ___ 
-## | ____| / \  |  _ \_ _|
-## |  _|  / _ \ | |_) | | 
-## | |__ / ___ \|  __/| | 
-## |____/_/   \_\_|  |___|  Extended API for Apache
-## ____________________________________________________________________________
-## 
-## Annotated patch file: eapi.patch
-## Copyright (c) 1998-2001 Ralf S. Engelschall, All Rights Reserved. 
-## Created on: 04-Oct-2002
-##
-## This file assembles changes to existing Apache source files
-## between the original Apache and the patched variant. It can be
-## automatically applied to a vanilla Apache source tree with the
-## 'patch' tool to upgrade those files.  Each patch snippet is
-## annotated with a short description.
-##
-## This file contains all patches to the Apache source
-## tree which add the Extended API (EAPI) support.
-##
-
-+---------------------------------------------------------------------------
-| Add the EAPI and EAPI_MM configuration entries which triggers the EAPI
-| patches and configured the shared memory support via the MM library.
-+---------------------------------------------------------------------------
-Index: src/Configuration.tmpl
---- src/Configuration.tmpl     28 Jan 2002 19:21:21 -0000      1.1.1.7
-+++ src/Configuration.tmpl     28 Jan 2002 19:40:56 -0000      1.23
-@@ -68,6 +105,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
-
-+---------------------------------------------------------------------------
-| Patch in implementation of the EAPI rule.
-+---------------------------------------------------------------------------
-Index: src/Configure
---- src/Configure      4 Oct 2002 11:50:12 -0000       1.1.1.20
-+++ src/Configure      4 Oct 2002 11:54:56 -0000       1.23
-@@ -1885,6 +1885,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 | sed -n -e '$p' | 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.
- ##
-
-+---------------------------------------------------------------------------
-| Add the build support for the ap_hook.c and ap_ctx.c sources (Unix)
-+---------------------------------------------------------------------------
-Index: src/ap/Makefile.tmpl
---- src/ap/Makefile.tmpl       19 Jun 2002 07:20:22 -0000      1.1.1.8
-+++ src/ap/Makefile.tmpl       19 Jun 2002 07:29:08 -0000      1.8
-@@ -7,7 +7,7 @@
- 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_ebcdic.o \
--     ap_strtol.o
-+     ap_strtol.o ap_hook.o ap_ctx.o ap_mm.o
- .c.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $<
-
-+---------------------------------------------------------------------------
-| Add the build support for the ap_hook.c and ap_ctx.c sources (Win32)
-+---------------------------------------------------------------------------
-Index: src/ap/ap.mak
---- src/ap/ap.mak      16 Oct 2001 11:47:06 -0000      1.1.1.9
-+++ src/ap/ap.mak      16 Oct 2001 11:57:38 -0000      1.9
-@@ -50,6 +50,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_sha1.obj"
-       -@erase "$(INTDIR)\ap_signal.obj"
-       -@erase "$(INTDIR)\ap_slack.obj"
-@@ -108,6 +111,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_sha1.obj" \
-       "$(INTDIR)\ap_signal.obj" \
-       "$(INTDIR)\ap_slack.obj" \
-@@ -144,6 +150,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_sha1.obj"
-       -@erase "$(INTDIR)\ap_signal.obj"
-       -@erase "$(INTDIR)\ap_slack.obj"
-@@ -202,6 +211,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_sha1.obj" \
-       "$(INTDIR)\ap_signal.obj" \
-       "$(INTDIR)\ap_slack.obj" \
-
-+---------------------------------------------------------------------------
-| Replace the MODULE_MAGIC_COOKIE to allow us to distinguish between
-| EAPI-aware modules and standard modules.
-+---------------------------------------------------------------------------
-Index: src/include/ap_mmn.h
---- src/include/ap_mmn.h       19 Jun 2002 07:20:24 -0000      1.1.1.11
-+++ src/include/ap_mmn.h       19 Jun 2002 07:29:08 -0000      1.11
-@@ -239,7 +239,23 @@
-  * 19990320.13          - add ap_strtol()
-  */
-+/* 
-+ * Under Extended API situations we replace the magic cookie "AP13" with
-+ * "EAPI" to let us distinguish between the EAPI module structure (which
-+ * contain additional pointers at the end) and standard module structures
-+ * (which lack at least NULL's for the pointers at the end).  This is
-+ * important because standard ("AP13") modules would dump core when we
-+ * dispatch over the additional hooks because NULL's are missing at the end of
-+ * the module structure. See also the code in mod_so for details on loading
-+ * (we accept both "AP13" and "EAPI").
-+ */
-+#ifdef EAPI
-+#define MODULE_MAGIC_COOKIE_AP13 0x41503133UL /* "AP13" */
-+#define MODULE_MAGIC_COOKIE_EAPI 0x45415049UL /* "EAPI" */
-+#define MODULE_MAGIC_COOKIE      MODULE_MAGIC_COOKIE_EAPI 
-+#else
- #define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
-+#endif
- #ifndef MODULE_MAGIC_NUMBER_MAJOR
- #define MODULE_MAGIC_NUMBER_MAJOR 19990320
-
-+---------------------------------------------------------------------------
-| Add the additional prototypes and defines for the 
-| shared memory pools.
-+---------------------------------------------------------------------------
-Index: src/include/ap_alloc.h
---- src/include/ap_alloc.h     27 Mar 2002 15:22:56 -0000      1.1.1.5
-+++ src/include/ap_alloc.h     27 Mar 2002 15:30:02 -0000      1.6
-@@ -95,6 +95,15 @@
- API_EXPORT(pool *) ap_init_alloc(void);               /* Set up everything */
- void ap_cleanup_alloc(void);
- API_EXPORT(pool *) ap_make_sub_pool(pool *);  /* All pools are subpools of permanent_pool */
-+#if defined(EAPI)
-+typedef enum { AP_POOL_RD, AP_POOL_RW } ap_pool_lock_mode;
-+int ap_shared_pool_possible(void);
-+void ap_init_alloc_shared(int);
-+void ap_kill_alloc_shared(void);
-+API_EXPORT(pool *) ap_make_shared_sub_pool(pool *);
-+API_EXPORT(int) ap_acquire_pool(pool *, ap_pool_lock_mode);
-+API_EXPORT(int) ap_release_pool(pool *);
-+#endif
- API_EXPORT(void) ap_destroy_pool(pool *);
- /* pools have nested lifetimes -- sub_pools are destroyed when the
-
-+---------------------------------------------------------------------------
-| Add the additional context variable `ctx' for BUFF structures.
-+---------------------------------------------------------------------------
-Index: src/include/buff.h
---- src/include/buff.h 27 Mar 2002 15:22:57 -0000      1.1.1.6
-+++ src/include/buff.h 27 Mar 2002 15:30:02 -0000      1.10
-@@ -125,6 +125,10 @@
-     /* transport handle, for RPC binding handle or some such */
-     void *t_handle;
-+#ifdef EAPI
-+    ap_ctx *ctx;
-+#endif /* EAPI */
-+
- #ifdef B_SFIO
-     Sfio_t *sf_in;
-     Sfio_t *sf_out;
-@@ -180,6 +184,10 @@
- /* Internal routines */
- API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb);
- API_EXPORT(int) ap_bfilbuf(BUFF *fb);
-+
-+#ifdef EAPI
-+#define ap_bpeekc(fb) ( ((fb)->incnt == 0) ? EOF : *((fb)->inptr) )
-+#endif
- #ifndef CHARSET_EBCDIC
-
-+---------------------------------------------------------------------------
-| Add the four additional Apache API module hooks.
-+---------------------------------------------------------------------------
-Index: src/include/http_config.h
---- src/include/http_config.h  27 Mar 2002 15:22:57 -0000      1.1.1.10
-+++ src/include/http_config.h  27 Mar 2002 15:30:02 -0000      1.12
-@@ -276,6 +276,65 @@
-     void (*child_exit) (server_rec *, pool *);
- #endif
-     int (*post_read_request) (request_rec *);
-+
-+#ifdef EAPI
-+    /*
-+     * ANSI C guarantees us that we can at least _extend_ the module structure
-+     * with additional hooks without the need to change all existing modules.
-+     * Because: ``If there are fewer initializers in the list than members of
-+     * the structure, the trailing members are initialized with 0.'' (The C
-+     * Programming Language, 2nd Ed., A8.7 Initialization). So we just
-+     * have to put our additional hooks here:
-+     *
-+     * add_module: 
-+     *     Called from within ap_add_module() right after the module structure
-+     *     was linked into the Apache internal module list.  It is mainly
-+     *     intended to be used to define configuration defines (<IfDefine>)
-+     *     which have to be available directly after a LoadModule/AddModule.
-+     *     Actually this is the earliest possible hook a module can use.
-+     *
-+     * remove_module: 
-+     *     Called from within ap_remove_module() right before the module
-+     *     structure is kicked out from the Apache internal module list.
-+     *     Actually this is last possible hook a module can use and exists for
-+     *     consistency with the add_module hook.
-+     *
-+     * rewrite_command:
-+     *     Called right after a configuration directive line was read and
-+     *     before it is processed. It is mainly intended to be used for
-+     *     rewriting directives in order to provide backward compatibility to
-+     *     old directive variants.
-+     *
-+     * new_connection:
-+     *     Called from within the internal new_connection() function, right
-+     *     after the conn_rec structure for the new established connection was
-+     *     created and before Apache starts processing the request with
-+     *     ap_read_request().  It is mainly intended to be used to setup/run
-+     *     connection dependent things like sending start headers for
-+     *     on-the-fly compression, etc.
-+     *
-+     * close_connection:
-+     *     Called from within the Apache dispatching loop just before any
-+     *     ap_bclose() is performed on the socket connection, but a long time
-+     *     before any pool cleanups are done for the connection (which can be
-+     *     too late for some applications).  It is mainly intended to be used
-+     *     to close/finalize connection dependent things like sending end
-+     *     headers for on-the-fly compression, etc.
-+     */
-+#ifdef ULTRIX_BRAIN_DEATH
-+    void  (*add_module) ();
-+    void  (*remove_module) ();
-+    char *(*rewrite_command) ();
-+    void  (*new_connection) ();
-+    void  (*close_connection) ();
-+#else
-+    void  (*add_module) (struct module_struct *);
-+    void  (*remove_module) (struct module_struct *);
-+    char *(*rewrite_command) (cmd_parms *, void *config, const char *);
-+    void  (*new_connection) (conn_rec *);
-+    void  (*close_connection) (conn_rec *);
-+#endif
-+#endif /* EAPI */
- } module;
- /* Initializer for the first few module slots, which are only
-
-+---------------------------------------------------------------------------
-| Add the additional variable `ap_global_ctx' for holding
-| global module context.
-+---------------------------------------------------------------------------
-Index: src/include/http_conf_globals.h
---- src/include/http_conf_globals.h    4 Oct 2002 11:50:14 -0000       1.1.1.12
-+++ src/include/http_conf_globals.h    4 Oct 2002 11:54:56 -0000       1.13
-@@ -95,6 +95,9 @@
- #endif
- extern int ap_dump_settings;
- extern API_VAR_EXPORT int ap_extended_status;
-+#ifdef EAPI
-+extern API_VAR_EXPORT ap_ctx *ap_global_ctx;
-+#endif /* EAPI */
- extern API_VAR_EXPORT char *ap_pid_fname;
- extern API_VAR_EXPORT char *ap_scoreboard_fname;
-
-+---------------------------------------------------------------------------
-| Export the ap_set_callback_and_alarm() function because this
-| first is a useful thing and second we need it because all
-| other API/timeout functions deal with a request_rec while
-| some modules need a generic timeout mechanism.
-+---------------------------------------------------------------------------
-Index: src/include/http_main.h
-
-+---------------------------------------------------------------------------
-| First add support for the HTTPS protocol scheme via hooks,
-| second add the additional context variable `ctx' for the
-| conn_rec, server_rec and request_rec structures. And third
-| add a prototype for the additional ap_add_config_define()
-| function.
-+---------------------------------------------------------------------------
-Index: src/include/httpd.h
---- src/include/httpd.h        4 Oct 2002 11:50:14 -0000       1.1.1.20
-+++ src/include/httpd.h        4 Oct 2002 11:54:56 -0000       1.30
-@@ -70,7 +70,19 @@
- /* Headers in which EVERYONE has an interest... */
- #include "ap_config.h"
-+#ifdef EAPI
-+#include "ap_mm.h"
-+#endif
- #include "ap_alloc.h"
-+/*
-+ * Include the Extended API headers.
-+ * Don't move the position. It has to be after ap_alloc.h because it uses the
-+ * pool stuff but before buff.h because the buffer stuff uses the EAPI, too. 
-+ */
-+#ifdef EAPI
-+#include "ap_hook.h"
-+#include "ap_ctx.h"
-+#endif /* EAPI */
- #include "buff.h"
- #include "ap.h"
-@@ -141,12 +153,17 @@
- #define DEFAULT_HTTP_PORT     80
- #define DEFAULT_HTTPS_PORT    443
- #define ap_is_default_port(port,r)    ((port) == ap_default_port(r))
-+#ifdef EAPI
-+#define ap_http_method(r)   (((r)->ctx != NULL && ap_ctx_get((r)->ctx, "ap::http::method") != NULL) ? ((char *)ap_ctx_get((r)->ctx, "ap::http::method")) : "http")
-+#define ap_default_port(r)  (((r)->ctx != NULL && ap_ctx_get((r)->ctx, "ap::default::port") != NULL) ? atoi((char *)ap_ctx_get((r)->ctx, "ap::default::port")) : DEFAULT_HTTP_PORT)
-+#else /* EAPI */
- #ifdef NETWARE
- #define ap_http_method(r) ap_os_http_method(r)
- #else
- #define ap_http_method(r)     "http"
- #endif
- #define ap_default_port(r)    DEFAULT_HTTP_PORT
-+#endif /* EAPI */
- /* --------- Default user name and group name running standalone ---------- */
- /* --- These may be specified as numbers by placing a # before a number --- */
-@@ -351,6 +368,19 @@
- #define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
- #endif
-+/*
-+ * Unix only:
-+ * Path to Shared Memory Files 
-+ */
-+#ifdef EAPI
-+#ifndef EAPI_MM_CORE_PATH
-+#define EAPI_MM_CORE_PATH "logs/mm"
-+#endif
-+#ifndef EAPI_MM_CORE_MAXSIZE
-+#define EAPI_MM_CORE_MAXSIZE 1024*1024*1 /* max. 1MB */
-+#endif
-+#endif
-+
- /* Number of requests to try to handle in a single process.  If <= 0,
-  * the children don't die off.  That's the default here, since I'm still
-  * interested in finding and stanching leaks.
-@@ -443,6 +473,9 @@
- API_EXPORT(const char *) ap_get_server_version(void);
- API_EXPORT(void) ap_add_version_component(const char *component);
- API_EXPORT(const char *) ap_get_server_built(void);
-+#ifdef EAPI
-+API_EXPORT(void) ap_add_config_define(const char *define);
-+#endif /* EAPI */
- /* Numeric release version identifier: MMNNFFRBB: major minor fix final beta
-  * Always increases along the same track as the source branch.
-@@ -846,6 +879,10 @@
-  * record to improve 64bit alignment the next time we need to break
-  * binary compatibility for some other reason.
-  */
-+
-+#ifdef EAPI
-+    ap_ctx *ctx;
-+#endif /* EAPI */
- };
-@@ -894,6 +931,9 @@
-     char *local_host;         /* used for ap_get_server_name when
-                                * UseCanonicalName is set to DNS
-                                * (ignores setting of HostnameLookups) */
-+#ifdef EAPI
-+    ap_ctx *ctx;
-+#endif /* EAPI */
- };
- /* Per-vhost config... */
-@@ -966,6 +1006,10 @@
-     int limit_req_line;      /* limit on size of the HTTP request line    */
-     int limit_req_fieldsize; /* limit on size of any request header field */
-     int limit_req_fields;    /* limit on number of request header fields  */
-+
-+#ifdef EAPI
-+    ap_ctx *ctx;
-+#endif /* EAPI */
- };
- /* These are more like real hosts than virtual hosts */
-
-+---------------------------------------------------------------------------
-| Patch the shared memory pool support into the Apache pool facility.
-+---------------------------------------------------------------------------
-Index: src/main/alloc.c
---- src/main/alloc.c   4 Oct 2002 11:50:14 -0000       1.1.1.13
-+++ src/main/alloc.c   4 Oct 2002 11:54:56 -0000       1.20
-@@ -64,6 +64,10 @@
-  */
- #include "httpd.h"
-+#ifdef EAPI
-+#include "http_config.h"
-+#include "http_conf_globals.h"
-+#endif
- #include "multithread.h"
- #include "http_log.h"
-@@ -138,6 +142,10 @@
- #define BLOCK_MINALLOC        0
- #endif
-+#if defined(EAPI) && defined(EAPI_MM)
-+static AP_MM *mm = NULL;
-+#endif
-+
- /*****************************************************************
-  *
-  * Managing free storage blocks...
-@@ -166,6 +174,9 @@
-       char *endp;
-       union block_hdr *next;
-       char *first_avail;
-+#if defined(EAPI) && defined(EAPI_MM)
-+      int is_shm;
-+#endif
- #ifdef POOL_DEBUG
-       union block_hdr *global_next;
-       struct pool *owning_pool;
-@@ -216,7 +227,11 @@
- /* Get a completely new block from the system pool. Note that we rely on
-    malloc() to provide aligned memory. */
-+#if defined(EAPI) && defined(EAPI_MM)
-+static union block_hdr *malloc_block(int size, int is_shm)
-+#else
- static union block_hdr *malloc_block(int size)
-+#endif
- {
-     union block_hdr *blok;
-@@ -230,12 +245,20 @@
-     ++num_malloc_calls;
-     num_malloc_bytes += size + sizeof(union block_hdr);
- #endif
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (is_shm)
-+        blok = (union block_hdr *)ap_mm_malloc(mm, size + sizeof(union block_hdr));
-+    else
-+#endif
-     blok = (union block_hdr *) malloc(size + sizeof(union block_hdr));
-     if (blok == NULL) {
-       fprintf(stderr, "Ouch!  malloc failed in malloc_block()\n");
-       exit(1);
-     }
-     debug_fill(blok, size + sizeof(union block_hdr));
-+#if defined(EAPI) && defined(EAPI_MM)
-+    blok->h.is_shm = is_shm;
-+#endif
-     blok->h.next = NULL;
-     blok->h.first_avail = (char *) (blok + 1);
-     blok->h.endp = size + blok->h.first_avail;
-@@ -296,6 +319,10 @@
-     if (blok == NULL)
-       return;                 /* Sanity check --- freeing empty pool? */
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+        (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-     old_free_list = block_freelist;
-     block_freelist = blok;
-@@ -342,6 +369,10 @@
- #endif
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+        (void)ap_mm_unlock(mm);
-+#endif
- #endif
- }
-@@ -350,7 +381,11 @@
-  * if necessary.  Must be called with alarms blocked.
-  */
-+#if defined(EAPI) && defined(EAPI_MM)
-+static union block_hdr *new_block(int min_size, int is_shm)
-+#else
- static union block_hdr *new_block(int min_size)
-+#endif
- {
-     union block_hdr **lastptr = &block_freelist;
-     union block_hdr *blok = block_freelist;
-@@ -360,7 +395,12 @@
-      */
-     while (blok != NULL) {
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm == is_shm &&
-+        min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
-+#else
-       if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) {
-+#endif
-           *lastptr = blok->h.next;
-           blok->h.next = NULL;
-           debug_verify_filled(blok->h.first_avail, blok->h.endp,
-@@ -376,7 +416,11 @@
-     /* Nope. */
-     min_size += BLOCK_MINFREE;
-+#if defined(EAPI) && defined(EAPI_MM)
-+    blok = malloc_block((min_size > BLOCK_MINALLOC) ? min_size : BLOCK_MINALLOC, is_shm);
-+#else
-     blok = malloc_block((min_size > BLOCK_MINALLOC) ? min_size : BLOCK_MINALLOC);
-+#endif
-     return blok;
- }
-@@ -426,6 +470,9 @@
- #ifdef POOL_DEBUG
-     struct pool *joined;
- #endif
-+#if defined(EAPI) && defined(EAPI_MM)
-+    int is_shm;
-+#endif
- };
- static pool *permanent_pool;
-@@ -440,16 +487,28 @@
- #define POOL_HDR_CLICKS (1 + ((sizeof(struct pool) - 1) / CLICK_SZ))
- #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ)
-+#if defined(EAPI) && defined(EAPI_MM)
-+static struct pool *make_sub_pool_internal(struct pool *p, int is_shm)
-+#else
- API_EXPORT(struct pool *) ap_make_sub_pool(struct pool *p)
-+#endif
- {
-     union block_hdr *blok;
-     pool *new_pool;
-     ap_block_alarms();
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (is_shm)
-+        (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    blok = new_block(POOL_HDR_BYTES, is_shm);
-+#else
-     blok = new_block(POOL_HDR_BYTES);
-+#endif
-     new_pool = (pool *) blok->h.first_avail;
-     blok->h.first_avail += POOL_HDR_BYTES;
- #ifdef POOL_DEBUG
-@@ -468,12 +527,38 @@
-       p->sub_pools = new_pool;
-     }
-+#if defined(EAPI) && defined(EAPI_MM)
-+    new_pool->is_shm = is_shm;
-+#endif
-+
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (is_shm)
-+      (void)ap_mm_unlock(mm);
-+#endif
-     ap_unblock_alarms();
-     return new_pool;
- }
-+#if defined(EAPI)
-+#if defined(EAPI_MM)
-+API_EXPORT(struct pool *) ap_make_sub_pool(struct pool *p)
-+{
-+    return make_sub_pool_internal(p, 0);
-+}
-+API_EXPORT(struct pool *) ap_make_shared_sub_pool(struct pool *p)
-+{
-+    return make_sub_pool_internal(p, 1);
-+}
-+#else
-+API_EXPORT(struct pool *) ap_make_shared_sub_pool(struct pool *p)
-+{
-+    return NULL;
-+}
-+#endif
-+#endif
-+
- #ifdef POOL_DEBUG
- static void stack_var_init(char *s)
- {
-@@ -488,6 +573,13 @@
- }
- #endif
-+#if defined(EAPI)
-+int ap_shared_pool_possible(void)
-+{
-+    return ap_mm_useable();
-+}
-+#endif
-+
- #ifdef ALLOC_STATS
- static void dump_stats(void)
- {
-@@ -520,6 +612,58 @@
-     return permanent_pool;
- }
-+#if defined(EAPI)
-+void ap_init_alloc_shared(int early)
-+{
-+#if defined(EAPI_MM)
-+    int mm_size;
-+    char *mm_path;
-+    char *err1, *err2;
-+
-+    if (early) {
-+        /* process very early on startup */
-+        mm_size = ap_mm_maxsize();
-+        if (mm_size > EAPI_MM_CORE_MAXSIZE)
-+            mm_size = EAPI_MM_CORE_MAXSIZE;
-+        mm_path = ap_server_root_relative(permanent_pool, 
-+                  ap_psprintf(permanent_pool, "%s.%ld", 
-+                              EAPI_MM_CORE_PATH, (long)getpid()));
-+        if ((mm = ap_mm_create(mm_size, mm_path)) == NULL) {
-+            fprintf(stderr, "Ouch! ap_mm_create(%d, \"%s\") failed\n", mm_size, mm_path);
-+            err1 = ap_mm_error();
-+            if (err1 == NULL)
-+                err1 = "-unknown-";
-+            err2 = strerror(errno);
-+            if (err2 == NULL)
-+                err2 = "-unknown-";
-+            fprintf(stderr, "Error: MM: %s: OS: %s\n", err1, err2);
-+            exit(1);
-+        }
-+    }
-+    else {
-+        /* process a lot later on startup */
-+#ifdef WIN32
-+        ap_mm_permission(mm, (_S_IREAD|_S_IWRITE), ap_user_id, -1);
-+#else
-+        ap_mm_permission(mm, (S_IRUSR|S_IWUSR), ap_user_id, -1);
-+#endif
-+    }
-+#endif /* EAPI_MM */
-+    return; 
-+}
-+
-+void ap_kill_alloc_shared(void)
-+{
-+#if defined(EAPI_MM)
-+    if (mm != NULL) {
-+        ap_mm_destroy(mm);
-+        mm = NULL;
-+    }
-+#endif /* EAPI_MM */
-+    return;
-+}
-+#endif /* EAPI */
-+
- void ap_cleanup_alloc(void)
- {
-     ap_destroy_mutex(alloc_mutex);
-@@ -530,10 +674,18 @@
- {
-     ap_block_alarms();
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+        (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-     while (a->sub_pools)
-       ap_destroy_pool(a->sub_pools);
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+          (void)ap_mm_unlock(mm);
-+#endif
-     /* Don't hold the mutex during cleanups. */
-     run_cleanups(a->cleanups);
-     a->cleanups = NULL;
-@@ -567,6 +719,10 @@
-     ap_block_alarms();
-     ap_clear_pool(a);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+      (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-     if (a->parent) {
-       if (a->parent->sub_pools == a)
-@@ -577,6 +733,10 @@
-           a->sub_next->sub_prev = a->sub_prev;
-     }
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+      (void)ap_mm_unlock(mm);
-+#endif
-     free_blocks(a->first);
-     ap_unblock_alarms();
-@@ -591,6 +751,30 @@
-     return bytes_in_block_list(block_freelist);
- }
-+#if defined(EAPI)
-+API_EXPORT(int) ap_acquire_pool(pool *p, ap_pool_lock_mode mode)
-+{
-+#if defined(EAPI_MM)
-+    if (!p->is_shm)
-+        return 1;
-+    return ap_mm_lock(mm, mode == AP_POOL_RD ? AP_MM_LOCK_RD : AP_MM_LOCK_RW);
-+#else
-+      return 1;
-+#endif
-+}
-+
-+API_EXPORT(int) ap_release_pool(pool *p)
-+{
-+#if defined(EAPI_MM)
-+    if (!p->is_shm)
-+        return 1;
-+    return ap_mm_unlock(mm);
-+#else
-+      return 1;
-+#endif
-+}
-+#endif /* EAPI */
-+
- /*****************************************************************
-  * POOL_DEBUG support
-  */
-@@ -756,16 +940,31 @@
-     ap_block_alarms();
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+      (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    blok = new_block(size, a->is_shm);
-+#else
-     blok = new_block(size);
-+#endif
-     a->last->h.next = blok;
-     a->last = blok;
- #ifdef POOL_DEBUG
-     blok->h.owning_pool = a;
- #endif
-+#if defined(EAPI) && defined(EAPI_MM)
-+    blok->h.is_shm = a->is_shm;
-+#endif
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (a->is_shm)
-+      (void)ap_mm_unlock(mm);
-+#endif
-     ap_unblock_alarms();
-@@ -882,6 +1081,11 @@
-     size = cur_len << 1;
-     if (size < AP_PSPRINTF_MIN_SIZE)
-         size = AP_PSPRINTF_MIN_SIZE;
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (ps->block->h.is_shm)
-+        ptr = ap_mm_realloc(ps->base, size);
-+    else
-+#endif
-     ptr = realloc(ps->base, size);
-     if (ptr == NULL) {
-       fputs("Ouch!  Out of memory!\n", stderr);
-@@ -905,9 +1109,21 @@
-         size = AP_PSPRINTF_MIN_SIZE;
-     /* must try another blok */
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+      (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-     (void) ap_acquire_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    nblok = new_block(size, blok->h.is_shm);
-+#else
-     nblok = new_block(size);
-+#endif
-     (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+      (void)ap_mm_unlock(mm);
-+#endif
-     memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len);
-     ps->vbuff.curpos = nblok->h.first_avail + cur_len;
-     /* save a byte for the NUL terminator */
-@@ -916,10 +1132,18 @@
-     /* did we allocate the current blok? if so free it up */
-     if (ps->got_a_new_block) {
-       debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+      (void)ap_mm_lock(mm, AP_MM_LOCK_RW);
-+#endif
-       (void) ap_acquire_mutex(alloc_mutex);
-       blok->h.next = block_freelist;
-       block_freelist = blok;
-       (void) ap_release_mutex(alloc_mutex);
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (blok->h.is_shm)
-+      (void)ap_mm_unlock(mm);
-+#endif
-     }
-     ps->blok = nblok;
-     ps->got_a_new_block = 1;
-@@ -938,6 +1162,11 @@
-     void *ptr;
-     ap_block_alarms();
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (p->is_shm)
-+        ps.base = ap_mm_malloc(mm, 512);
-+    else
-+#endif
-     ps.base = malloc(512);
-     if (ps.base == NULL) {
-       fputs("Ouch!  Out of memory!\n", stderr);
-@@ -950,6 +1179,11 @@
-     *ps.vbuff.curpos++ = '\0';
-     ptr = ps.base;
-     /* shrink */
-+#if defined(EAPI) && defined(EAPI_MM)
-+    if (p->is_shm)
-+        ptr = ap_mm_realloc(ptr, (char *)ps.vbuff.curpos - (char *)ptr);
-+    else
-+#endif
-     ptr = realloc(ptr, (char *)ps.vbuff.curpos - (char *)ptr);
-     if (ptr == NULL) {
-       fputs("Ouch!  Out of memory!\n", stderr);
-
-+---------------------------------------------------------------------------
-| Patch the low-level buffer routines to additionally allow
-| modules to intercept the I/O processing via hooks.
-+---------------------------------------------------------------------------
-Index: src/main/buff.c
---- src/main/buff.c    27 Mar 2002 15:23:00 -0000      1.1.1.12
-+++ src/main/buff.c    27 Mar 2002 15:30:02 -0000      1.20
-@@ -293,6 +293,9 @@
-     }
-     else
- #endif
-+#ifdef EAPI
-+      if (!ap_hook_call("ap::buff::read", &rv, fb, buf, nbyte))
-+#endif /* EAPI */
-       rv = read(fb->fd_in, buf, nbyte);
-     
-     return rv;
-@@ -304,6 +307,9 @@
- #if defined (WIN32) || defined(NETWARE) || defined(CYGWIN_WINSOCK) 
-     if (fb->flags & B_SOCKET) {
-+#ifdef EAPI
-+      if (!ap_hook_call("ap::buff::recvwithtimeout", &rv, fb, buf, nbyte))
-+#endif /* EAPI */
-       rv = ap_recvwithtimeout(fb->fd_in, buf, nbyte, 0);
-       if (rv == SOCKET_ERROR)
-           errno = WSAGetLastError();
-@@ -351,6 +357,9 @@
-     }
-     else
- #endif
-+#ifdef EAPI
-+      if (!ap_hook_call("ap::buff::write", &rv, fb, buf, nbyte))
-+#endif /* EAPI */
- #if defined (B_SFIO)
-       rv = sfwrite(fb->sf_out, buf, nbyte);
- #else
-@@ -381,6 +390,9 @@
-    
- #if defined(WIN32) || defined(NETWARE)
-     if (fb->flags & B_SOCKET) {
-+#ifdef EAPI
-+      if (!ap_hook_call("ap::buff::sendwithtimeout", &rv, fb, buf, nbyte))
-+#endif /* EAPI */
-       rv = ap_sendwithtimeout(fb->fd, buf, nbyte, 0);
-       if (rv == SOCKET_ERROR)
-           errno = WSAGetLastError();
-@@ -464,6 +476,10 @@
-     fb->callback_data = NULL;
-     fb->filter_callback = NULL;
-+#ifdef EAPI
-+    fb->ctx = ap_ctx_new(p);
-+#endif /* EAPI */
-+
-     return fb;
- }
-@@ -1116,6 +1132,9 @@
-     i = 0;
-     while (i < nvec) {
-       do
-+#ifdef EAPI
-+          if (!ap_hook_call("ap::buff::writev", &rv, fb, &vec[i], nvec -i))
-+#endif /* EAPI */
-           rv = writev(fb->fd, &vec[i], nvec - i);
-       while (rv == -1 && (errno == EINTR || errno == EAGAIN)
-              && !(fb->flags & B_EOUT));
-
-+---------------------------------------------------------------------------
-| Add the implementation of the additional `add_module' and
-| `rewrite_command' module hooks. Additionally the `ctx'
-| variables are initialized.
-+---------------------------------------------------------------------------
-Index: src/main/http_config.c
---- src/main/http_config.c     4 Oct 2002 11:50:15 -0000       1.1.1.15
-+++ src/main/http_config.c     4 Oct 2002 11:54:56 -0000       1.18
-@@ -600,6 +600,20 @@
-       m->name = tmp;
-     }
- #endif /*_OSD_POSIX*/
-+
-+#ifdef EAPI
-+    /*
-+     * Invoke the `add_module' hook inside the now existing set
-+     * of modules to let them all now that this module was added.
-+     */
-+    {
-+        module *m2;
-+        for (m2 = top_module; m2 != NULL; m2 = m2->next)
-+            if (m2->magic == MODULE_MAGIC_COOKIE_EAPI)
-+                if (m2->add_module != NULL)
-+                    (*m2->add_module)(m);
-+    }
-+#endif /* EAPI */
- }
- /* 
-@@ -614,6 +628,21 @@
- {
-     module *modp;
-+#ifdef EAPI
-+    /*
-+     * Invoke the `remove_module' hook inside the now existing
-+     * set of modules to let them all now that this module is
-+     * beeing removed.
-+     */
-+    {
-+        module *m2;
-+        for (m2 = top_module; m2 != NULL; m2 = m2->next)
-+            if (m2->magic == MODULE_MAGIC_COOKIE_EAPI)
-+                if (m2->remove_module != NULL)
-+                    (*m2->remove_module)(m);
-+    }
-+#endif /* EAPI */
-+
-     modp = top_module;
-     if (modp == m) {
-       /* We are the top module, special case */
-@@ -1007,6 +1036,27 @@
-     const command_rec *cmd;
-     module *mod = top_module;
-+#ifdef EAPI
-+    /*
-+     * Invoke the `rewrite_command' of modules to allow
-+     * they to rewrite the directive line before we
-+     * process it.
-+     */
-+    {
-+        module *m;
-+        char *cp;
-+        for (m = top_module; m != NULL; m = m->next) {
-+            if (m->magic == MODULE_MAGIC_COOKIE_EAPI) {
-+                if (m->rewrite_command != NULL) {
-+                    cp = (m->rewrite_command)(parms, config, l);
-+                    if (cp != NULL)
-+                        l = cp;
-+                }
-+            }
-+        }
-+    }
-+#endif /* EAPI */
-+
-     if ((l[0] == '#') || (!l[0]))
-       return NULL;
-@@ -1467,6 +1517,10 @@
-     s->limit_req_fieldsize = main_server->limit_req_fieldsize;
-     s->limit_req_fields = main_server->limit_req_fields;
-+#ifdef EAPI
-+    s->ctx = ap_ctx_new(p);
-+#endif /* EAPI */
-+
-     *ps = s;
-     return ap_parse_vhost_addrs(p, hostname, s);
-@@ -1577,6 +1631,10 @@
-     s->module_config = create_server_config(p, s);
-     s->lookup_defaults = create_default_per_dir_config(p);
-+
-+#ifdef EAPI
-+    s->ctx = ap_ctx_new(p);
-+#endif /* EAPI */
-     return s;
- }
-
-+---------------------------------------------------------------------------
-| Add the ap_global_ctx variable and the new
-| ap_add_config_define() function. Additionally the
-| implementation of the additional `new_connection' module hook
-| is added plus the initialization of one more `ctx' variable.
-+---------------------------------------------------------------------------
-Index: src/main/http_main.c
---- src/main/http_main.c       4 Oct 2002 11:50:15 -0000       1.1.1.19
-+++ src/main/http_main.c       4 Oct 2002 11:54:56 -0000       1.41
-@@ -279,6 +279,9 @@
- int ap_dump_settings = 0;
- API_VAR_EXPORT int ap_extended_status = 0;
-+#ifdef EAPI
-+API_VAR_EXPORT ap_ctx *ap_global_ctx;
-+#endif /* EAPI */
- /*
-  * The max child slot ever assigned, preserved across restarts.  Necessary
-@@ -469,6 +472,30 @@
-     }
- }
-+#ifdef EAPI
-+API_EXPORT(void) ap_add_config_define(const char *define)
-+{
-+    char **var;
-+    var = (char **)ap_push_array(ap_server_config_defines);
-+    *var = ap_pstrdup(pcommands, define);
-+    return;
-+}
-+
-+/*
-+ * Invoke the `close_connection' hook of modules to let them do
-+ * some connection dependent actions before we close it.
-+ */
-+static void ap_call_close_connection_hook(conn_rec *c)
-+{
-+    module *m;
-+    for (m = top_module; m != NULL; m = m->next)
-+        if (m->magic == MODULE_MAGIC_COOKIE_EAPI)
-+            if (m->close_connection != NULL)
-+                (*m->close_connection)(c);
-+    return;
-+}
-+#endif /* EAPI */
-+
- #ifndef NETWARE
- static APACHE_TLS int volatile exit_after_unblock = 0;
- #endif
-@@ -1523,6 +1550,10 @@
-           ap_log_transaction(log_req);
-       }
-+#ifdef EAPI
-+      ap_call_close_connection_hook(save_req->connection);
-+#endif /* EAPI */
-+
-       ap_bsetflag(save_req->connection->client, B_EOUT, 1);
-       ap_bclose(save_req->connection->client);
-       
-@@ -1531,6 +1562,9 @@
-         ap_longjmp(jmpbuffer, 1);
-     }
-     else {                    /* abort the connection */
-+#ifdef EAPI
-+      ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-       ap_bsetflag(current_conn->client, B_EOUT, 1);
-       ap_bclose(current_conn->client);
-       current_conn->aborted = 1;
-@@ -1833,10 +1867,16 @@
-     /* Send any leftover data to the client, but never try to again */
-     if (ap_bflush(r->connection->client) == -1) {
-+#ifdef EAPI
-+      ap_call_close_connection_hook(r->connection);
-+#endif /* EAPI */
-       ap_kill_timeout(r);
-       ap_bclose(r->connection->client);
-       return;
-     }
-+#ifdef EAPI
-+    ap_call_close_connection_hook(r->connection);
-+#endif /* EAPI */
-     ap_bsetflag(r->connection->client, B_EOUT, 1);
-     /* Close our half of the connection --- send the client a FIN */
-@@ -2566,6 +2606,9 @@
-     /* Clear the pool - including any registered cleanups */
-     ap_destroy_pool(pglobal);
- #endif
-+#ifdef EAPI
-+    ap_kill_alloc_shared();
-+#endif
-     exit(code);
- }
-@@ -3577,6 +3620,24 @@
-     conn->remote_addr = *remaddr;
-     conn->remote_ip = ap_pstrdup(conn->pool,
-                             inet_ntoa(conn->remote_addr.sin_addr));
-+#ifdef EAPI
-+    conn->ctx = ap_ctx_new(conn->pool);
-+#endif /* EAPI */
-+
-+#ifdef EAPI
-+    /*
-+     * Invoke the `new_connection' hook of modules to let them do
-+     * some connection dependent actions before we go on with
-+     * processing the request on this connection.
-+     */
-+    {
-+        module *m;
-+        for (m = top_module; m != NULL; m = m->next)
-+            if (m->magic == MODULE_MAGIC_COOKIE_EAPI)
-+                if (m->new_connection != NULL)
-+                    (*m->new_connection)(conn);
-+    }
-+#endif /* EAPI */
-     return conn;
- }
-@@ -4005,6 +4066,15 @@
-     printf("Server's Module Magic Number: %u:%u\n",
-          MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
-     printf("Server compiled with....\n");
-+#ifdef EAPI
-+    printf(" -D EAPI\n");
-+#endif
-+#ifdef EAPI_MM
-+    printf(" -D EAPI_MM\n");
-+#ifdef EAPI_MM_CORE_PATH
-+    printf(" -D EAPI_MM_CORE_PATH=\"" EAPI_MM_CORE_PATH "\"\n");
-+#endif
-+#endif
- #ifdef TPF
-     show_os_specific_compile_settings();
- #endif
-@@ -4175,6 +4245,22 @@
-     ap_server_pre_read_config  = ap_make_array(pcommands, 1, sizeof(char *));
-     ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
-     ap_server_config_defines   = ap_make_array(pcommands, 1, sizeof(char *));
-+
-+#ifdef EAPI
-+    ap_hook_init();
-+    ap_hook_configure("ap::buff::read", 
-+                      AP_HOOK_SIG4(int,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_configure("ap::buff::write",  
-+                      AP_HOOK_SIG4(int,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_configure("ap::buff::writev",  
-+                      AP_HOOK_SIG4(int,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_configure("ap::buff::sendwithtimeout", 
-+                      AP_HOOK_SIG4(int,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_configure("ap::buff::recvwithtimeout", 
-+                      AP_HOOK_SIG4(int,ptr,ptr,int), AP_HOOK_TOPMOST);
-+
-+    ap_global_ctx = ap_ctx_new(NULL);
-+#endif /* EAPI */
- }
- #ifndef MULTITHREAD
-@@ -4625,6 +4711,9 @@
-           ap_sync_scoreboard_image();
-           if (ap_scoreboard_image->global.running_generation != ap_my_generation) {
-+#ifdef EAPI
-+              ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-               ap_bclose(conn_io);
-               clean_child_exit(0);
-           }
-@@ -4653,6 +4742,9 @@
-        */
- #ifdef NO_LINGCLOSE
-+#ifdef EAPI
-+      ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-       ap_bclose(conn_io);     /* just close it */
- #else
-       if (r && r->connection
-@@ -4663,6 +4755,9 @@
-           lingering_close(r);
-       }
-       else {
-+#ifdef EAPI
-+          ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-           ap_bsetflag(conn_io, B_EOUT, 1);
-           ap_bclose(conn_io);
-       }
-@@ -5428,16 +5523,31 @@
-           usage(argv[0]);
-       }
-     }
-+#ifdef EAPI
-+    ap_init_alloc_shared(TRUE);
-+#endif
-     ap_suexec_enabled = init_suexec();
-     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
-+#ifdef EAPI
-+    ap_init_alloc_shared(FALSE);
-+#endif
-+
-     if (ap_configtestonly) {
-         fprintf(stderr, "Syntax OK\n");
-+#ifdef EAPI
-+        clean_parent_exit(0);
-+#else
-         exit(0);
-+#endif
-     }
-     if (ap_dump_settings) {
-+#ifdef EAPI
-+        clean_parent_exit(0);
-+#else
-         exit(0);
-+#endif
-     }
-     child_timeouts = !ap_standalone || one_process;
-@@ -5585,6 +5695,10 @@
-           ap_destroy_pool(r->pool);
-       }
-+#ifdef EAPI
-+      ap_call_close_connection_hook(conn);
-+#endif /* EAPI */
-+
-       ap_bclose(cio);
-     }
-     exit(0);
-@@ -5961,6 +6075,9 @@
-       ap_kill_cleanups_for_socket(ptrans, csd);
- #ifdef NO_LINGCLOSE
-+#ifdef EAPI
-+      ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-       ap_bclose(conn_io);     /* just close it */
- #else
-       if (r && r->connection
-@@ -5971,6 +6088,9 @@
-           lingering_close(r);
-       }
-       else {
-+#ifdef EAPI
-+          ap_call_close_connection_hook(current_conn);
-+#endif /* EAPI */
-           ap_bsetflag(conn_io, B_EOUT, 1);
-           ap_bclose(conn_io);
-       }
-@@ -7539,6 +7659,10 @@
-     if (!conf_specified)
-         ap_cpystrn(ap_server_confname, SERVER_CONFIG_FILE, sizeof(ap_server_confname));
-+#ifdef EAPI
-+    ap_init_alloc_shared(TRUE);
-+#endif
-+
-     if (!ap_os_is_path_absolute(ap_server_confname))
-         ap_cpystrn(ap_server_confname,
-                    ap_server_root_relative(pcommands, ap_server_confname),
-@@ -7578,6 +7702,9 @@
-     }
- #else /* ndef WIN32 */
-     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
-+#endif
-+#ifdef EAPI
-+    ap_init_alloc_shared(FALSE);
- #endif
-     if (ap_configtestonly) {
-
-+---------------------------------------------------------------------------
-| Just add the initialization of the `ctx' variable for
-| conn_rec structures.
-+---------------------------------------------------------------------------
-Index: src/main/http_request.c
---- src/main/http_request.c    19 Jun 2002 07:20:26 -0000      1.1.1.15
-+++ src/main/http_request.c    19 Jun 2002 07:29:09 -0000      1.15
-@@ -1375,6 +1375,10 @@
-     new->method          = r->method;
-     new->method_number   = r->method_number;
-+#ifdef EAPI
-+    /* initialize context _BEFORE_ ap_parse_uri() call */
-+    new->ctx             = r->ctx;
-+#endif /* EAPI */
-     ap_parse_uri(new, new_uri);
-     new->request_config = ap_create_request_config(r->pool);
-     new->per_dir_config = r->server->lookup_defaults;
-
-+---------------------------------------------------------------------------
-| Just add the initialization of the `ctx' variable for
-| request_rec structures.
-+---------------------------------------------------------------------------
-Index: src/main/http_protocol.c
---- src/main/http_protocol.c   4 Oct 2002 11:50:15 -0000       1.1.1.18
-+++ src/main/http_protocol.c   4 Oct 2002 11:54:56 -0000       1.18
-@@ -1203,6 +1203,10 @@
-     r->status          = HTTP_REQUEST_TIME_OUT;  /* Until we get a request */
-     r->the_request     = NULL;
-+#ifdef EAPI
-+    r->ctx = ap_ctx_new(r->pool);
-+#endif /* EAPI */
-+
- #ifdef CHARSET_EBCDIC
-     ap_bsetflag(r->connection->client, B_ASCII2EBCDIC, r->ebcdic.conv_in  = 1);
-     ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, r->ebcdic.conv_out = 1);
-@@ -1359,6 +1363,11 @@
-     rnew->read_body       = REQUEST_NO_BODY;
-     rnew->main = (request_rec *) r;
-+
-+#ifdef EAPI
-+    rnew->ctx = r->ctx;
-+#endif /* EAPI */
-+
- }
- API_EXPORT(void) ap_finalize_sub_req_protocol(request_rec *sub)
-
-+---------------------------------------------------------------------------
-| Add support for loading both EAPI and AP13 modules.
-+---------------------------------------------------------------------------
-Index: src/modules/standard/mod_so.c
---- src/modules/standard/mod_so.c      27 Mar 2002 15:23:06 -0000      1.1.1.9
-+++ src/modules/standard/mod_so.c      27 Mar 2002 15:30:03 -0000      1.10
-@@ -269,11 +269,24 @@
-      * Make sure the found module structure is really a module structure
-      * 
-      */
-+#ifdef EAPI
-+    if (   modp->magic != MODULE_MAGIC_COOKIE_AP13 
-+        && modp->magic != MODULE_MAGIC_COOKIE_EAPI) {
-+#else
-     if (modp->magic != MODULE_MAGIC_COOKIE) {
-+#endif
-         return ap_pstrcat(cmd->pool, "API module structure `", modname,
-                           "' in file ", szModuleFile, " is garbled -"
-                           " perhaps this is not an Apache module DSO?", NULL);
-     }
-+#ifdef EAPI
-+    if (modp->magic == MODULE_MAGIC_COOKIE_AP13) {
-+        ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, NULL,
-+                     "Loaded DSO %s uses plain Apache 1.3 API, "
-+                     "this module might crash under EAPI! "
-+                     "(please recompile it with -DEAPI)", filename);
-+    }
-+#endif
-     /* 
-      * Add this module to the Apache core structures
-
-+---------------------------------------------------------------------------
-| Add additional logging functions to the CustomLog directive
-| which can be used by other modules to create additional
-| logfile tags. Actually we add two types of hooks: One hook
-| for intercepting the new and generic %x (eXtension) tag and
-| one hook for creating new %x tags at all.
-+---------------------------------------------------------------------------
-Index: src/modules/standard/mod_log_config.c
---- src/modules/standard/mod_log_config.c      19 Jun 2002 07:20:30 -0000      1.1.1.13
-+++ src/modules/standard/mod_log_config.c      19 Jun 2002 07:29:09 -0000      1.26
-@@ -262,6 +262,9 @@
- typedef const char *(*item_key_func) (request_rec *, char *);
- typedef struct {
-+#ifdef EAPI
-+    char ch;
-+#endif
-     item_key_func func;
-     char *arg;
-     int condition_sense;
-@@ -580,15 +583,36 @@
-     }
- };
-+#ifdef EAPI
-+static struct log_item_list *find_log_func(pool *p, char k)
-+#else /* EAPI */
- static struct log_item_list *find_log_func(char k)
-+#endif /* EAPI */
- {
-     int i;
-+#ifdef EAPI
-+    struct log_item_list *lil;
-+#endif /* EAPI */
-     for (i = 0; log_item_keys[i].ch; ++i)
-         if (k == log_item_keys[i].ch) {
-             return &log_item_keys[i];
-         }
-+#ifdef EAPI
-+    if (ap_hook_status(ap_psprintf(p, "ap::mod_log_config::log_%c", k)) 
-+        != AP_HOOK_STATE_NOTEXISTANT) {
-+        lil = (struct log_item_list *)
-+              ap_pcalloc(p, sizeof(struct log_item_list));
-+        if (lil == NULL)
-+            return NULL;
-+        lil->ch = k;
-+        lil->func = NULL;
-+        lil->want_orig_default = 0;
-+        return lil;
-+    }
-+#endif /* EAPI */
-+
-     return NULL;
- }
-@@ -714,7 +738,11 @@
-             break;
-         default:
-+#ifdef EAPI
-+            l = find_log_func(p, *s++);
-+#else /* EAPI */
-             l = find_log_func(*s++);
-+#endif /* EAPI */
-             if (!l) {
-                 char dummy[2];
-@@ -723,6 +751,9 @@
-                 return ap_pstrcat(p, "Unrecognized LogFormat directive %",
-                                dummy, NULL);
-             }
-+#ifdef EAPI
-+            it->ch = s[-1];
-+#endif
-             it->func = l->func;
-             if (it->want_orig == -1) {
-                 it->want_orig = l->want_orig_default;
-@@ -784,6 +815,15 @@
-     /* We do.  Do it... */
-+#ifdef EAPI
-+    if (item->func == NULL) {
-+        cp = NULL;
-+        ap_hook_use(ap_psprintf(r->pool, "ap::mod_log_config::log_%c", item->ch),
-+                    AP_HOOK_SIG3(ptr,ptr,ptr), AP_HOOK_DECLINE(NULL),
-+                    &cp, r, item->arg);
-+    }
-+    else
-+#endif
-     cp = (*item->func) (item->want_orig ? orig : r, item->arg);
-     return cp ? cp : "-";
- }
-
-+---------------------------------------------------------------------------
-| Allow RewriteCond and RewriteRule directives to lookup 
-| variables from other modules.
-+---------------------------------------------------------------------------
-Index: src/modules/standard/mod_rewrite.c
---- src/modules/standard/mod_rewrite.c 4 Oct 2002 11:50:18 -0000       1.1.1.16
-+++ src/modules/standard/mod_rewrite.c 4 Oct 2002 11:54:56 -0000       1.14
-@@ -3691,6 +3691,15 @@
-     }
- #endif /* ndef WIN32 && NETWARE*/
-+#ifdef EAPI
-+    else {
-+        ap_hook_use("ap::mod_rewrite::lookup_variable",
-+                    AP_HOOK_SIG3(ptr,ptr,ptr), 
-+                    AP_HOOK_DECLINE(NULL),
-+                    &result, r, var);
-+    }
-+#endif
-+
-     if (result == NULL) {
-         return ap_pstrdup(r->pool, "");
-     }
-
-+---------------------------------------------------------------------------
-| Add an EAPI hook to allow other modules to add content to 
-| the status HTML page.
-+---------------------------------------------------------------------------
-Index: src/modules/standard/mod_status.c
---- src/modules/standard/mod_status.c  27 Mar 2002 15:23:06 -0000      1.1.1.14
-+++ src/modules/standard/mod_status.c  27 Mar 2002 15:30:03 -0000      1.11
-@@ -717,6 +754,12 @@
- </table>\n", r);
- #endif
-       }
-+
-+#ifdef EAPI
-+    ap_hook_use("ap::mod_status::display",
-+                AP_HOOK_SIG4(void,ptr,int,int), AP_HOOK_ALL,
-+                r, no_table_report, short_report);
-+#endif
-     } else {
-
-+---------------------------------------------------------------------------
-| Add hooks to the scheme processing to allow other modules to
-| recognize more schemes by intercepting this processing.
-+---------------------------------------------------------------------------
-Index: src/modules/proxy/mod_proxy.c
---- src/modules/proxy/mod_proxy.c      19 Jun 2002 07:20:27 -0000      1.1.1.12
-+++ src/modules/proxy/mod_proxy.c      19 Jun 2002 07:29:09 -0000      1.19
-@@ -218,6 +218,9 @@
- static int proxy_fixup(request_rec *r)
- {
-     char *url, *p;
-+#ifdef EAPI
-+    int rc;
-+#endif /* EAPI */
-     if (r->proxyreq == NOT_PROXY || strncmp(r->filename, "proxy:", 6) != 0)
-         return DECLINED;
-@@ -225,6 +228,14 @@
-     url = &r->filename[6];
- /* canonicalise each specific scheme */
-+#ifdef EAPI
-+    if (ap_hook_use("ap::mod_proxy::canon",
-+                    AP_HOOK_SIG3(int,ptr,ptr),
-+                    AP_HOOK_DECLINE(DECLINED),
-+                    &rc, r, url) && rc != DECLINED)
-+        return rc;  
-+    else
-+#endif /* EAPI */
-     if (strncasecmp(url, "http:", 5) == 0)
-         return ap_proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT);
-     else if (strncasecmp(url, "ftp:", 4) == 0)
-@@ -240,9 +251,44 @@
- static void proxy_init(server_rec *r, pool *p)
- {
-     ap_proxy_garbage_init(r, p);
-+#ifdef EAPI
-+    ap_hook_use("ap::mod_proxy::init", 
-+                AP_HOOK_SIG3(void,ptr,ptr), AP_HOOK_ALL, r, p);
-+#endif
- }
--
-+#ifdef EAPI
-+static void proxy_addmod(module *m)
-+{
-+    /* export: ap_proxy_http_canon() as `ap::mod_proxy::http::canon' */
-+    ap_hook_configure("ap::mod_proxy::http::canon", 
-+                      AP_HOOK_SIG5(int,ptr,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_register("ap::mod_proxy::http::canon", 
-+                     ap_proxy_http_canon, AP_HOOK_NOCTX);
-+
-+    /* export: ap_proxy_http_handler() as `ap::mod_proxy::http::handler' */
-+    ap_hook_configure("ap::mod_proxy::http::handler", 
-+                      AP_HOOK_SIG6(int,ptr,ptr,ptr,ptr,int), AP_HOOK_TOPMOST);
-+    ap_hook_register("ap::mod_proxy::http::handler", 
-+                     ap_proxy_http_handler, AP_HOOK_NOCTX);
-+
-+    /* export: ap_proxyerror() as `ap::mod_proxy::error' */
-+    ap_hook_configure("ap::mod_proxy::error", 
-+                      AP_HOOK_SIG3(int,ptr,ptr), AP_HOOK_TOPMOST);
-+    ap_hook_register("ap::mod_proxy::error", 
-+                     ap_proxyerror, AP_HOOK_NOCTX);
-+    return;
-+}
-+
-+static void proxy_remmod(module *m)
-+{
-+      /* remove the hook references */
-+    ap_hook_unregister("ap::mod_proxy::http::canon", ap_proxy_http_canon);
-+    ap_hook_unregister("ap::mod_proxy::http::handler", ap_proxy_http_handler);
-+    ap_hook_unregister("ap::mod_proxy::error", ap_proxyerror);
-+    return;
-+}
-+#endif /* EAPI */
- /* Send a redirection if the request contains a hostname which is not */
- /* fully qualified, i.e. doesn't have a domain name appended. Some proxy */
-@@ -374,6 +420,14 @@
-                  * CONNECT is a special method that bypasses the normal proxy
-                  * code.
-                  */
-+#ifdef EAPI
-+              if (!ap_hook_use("ap::mod_proxy::handler",
-+                               AP_HOOK_SIG7(int,ptr,ptr,ptr,ptr,int,ptr),
-+                               AP_HOOK_DECLINE(DECLINED),
-+                               &rc, r, cr, url, 
-+                               ents[i].hostname, ents[i].port, 
-+                               ents[i].protocol) || rc == DECLINED) {
-+#endif /* EAPI */
-                 if (r->method_number == M_CONNECT)
-                     rc = ap_proxy_connect_handler(r, cr, url, ents[i].hostname,
-                                                   ents[i].port);
-@@ -383,6 +437,9 @@
-                                                ents[i].port);
-                 else
-                     rc = DECLINED;
-+#ifdef EAPI
-+              }
-+#endif /* EAPI */
-                 /* an error or success */
-                 if (rc != DECLINED && rc != HTTP_BAD_GATEWAY)
-@@ -397,6 +454,14 @@
-      */
-     /* handle the scheme */
-+#ifdef EAPI
-+    if (ap_hook_use("ap::mod_proxy::handler",
-+                  AP_HOOK_SIG7(int,ptr,ptr,ptr,ptr,int,ptr),
-+                  AP_HOOK_DECLINE(DECLINED),
-+                  &rc, r, cr, url, 
-+                    NULL, 0, scheme) && rc != DECLINED)
-+        return rc;
-+#endif /* EAPI */
-     if (r->method_number == M_CONNECT) {
-         return ap_proxy_connect_handler(r, cr, url, NULL, 0);
-     }
-@@ -994,4 +1059,10 @@
-     NULL,                       /* child_init */
-     NULL,                       /* child_exit */
-     proxy_detect                /* post read-request */
-+#ifdef EAPI
-+   ,proxy_addmod,             /* EAPI: add_module */
-+    proxy_remmod,             /* EAPI: remove_module */
-+    NULL,                     /* EAPI: rewrite_command */
-+    NULL                      /* EAPI: new_connection  */
-+#endif
- };
-
-+---------------------------------------------------------------------------
-| Add hooks to the HTTP processing to allow other modules
-| to enhance it by intercepting this processing.
-+---------------------------------------------------------------------------
-Index: src/modules/proxy/proxy_http.c
---- src/modules/proxy/proxy_http.c     4 Oct 2002 11:50:16 -0000       1.1.1.15
-+++ src/modules/proxy/proxy_http.c     4 Oct 2002 11:54:56 -0000       1.23
-@@ -170,6 +170,9 @@
-     const char *datestr, *urlstr;
-     int result, major, minor;
-     const char *content_length;
-+#ifdef EAPI
-+    char *peer;
-+#endif
-     void *sconf = r->server->module_config;
-     proxy_server_conf *conf =
-@@ -191,6 +194,12 @@
-         return HTTP_BAD_REQUEST;
-     urlptr += 3;
-     destport = DEFAULT_HTTP_PORT;
-+#ifdef EAPI
-+    ap_hook_use("ap::mod_proxy::http::handler::set_destport", 
-+                AP_HOOK_SIG2(int,ptr), 
-+                AP_HOOK_TOPMOST,
-+                &destport, r);
-+#endif /* EAPI */
-     strp = strchr(urlptr, '/');
-     if (strp == NULL) {
-         desthost = ap_pstrdup(p, urlptr);
-@@ -228,12 +237,18 @@
-         err = ap_proxy_host2addr(proxyhost, &server_hp);
-         if (err != NULL)
-             return DECLINED;    /* try another */
-+#ifdef EAPI
-+      peer = ap_psprintf(p, "%s:%u", proxyhost, proxyport);  
-+#endif
-     }
-     else {
-         server.sin_port = htons((unsigned short)destport);
-         err = ap_proxy_host2addr(desthost, &server_hp);
-         if (err != NULL)
-             return ap_proxyerror(r, HTTP_INTERNAL_SERVER_ERROR, err);
-+#ifdef EAPI
-+      peer =  ap_psprintf(p, "%s:%u", desthost, destport);  
-+#endif
-     }
-@@ -308,14 +323,42 @@
-     f = ap_bcreate(p, B_RDWR | B_SOCKET);
-     ap_bpushfd(f, sock, sock);
-+#ifdef EAPI
-+    {
-+        char *errmsg = NULL;
-+        ap_hook_use("ap::mod_proxy::http::handler::new_connection", 
-+                    AP_HOOK_SIG4(ptr,ptr,ptr,ptr), 
-+                    AP_HOOK_DECLINE(NULL),
-+                    &errmsg, r, f, peer);
-+        if (errmsg != NULL)
-+            return ap_proxyerror(r, HTTP_BAD_GATEWAY, errmsg);
-+    }
-+#endif /* EAPI */
-+
-     ap_hard_timeout("proxy send", r);
-     ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.1" CRLF,
-               NULL);
-+#ifdef EAPI
-+    {
-+      int rc = DECLINED;
-+      ap_hook_use("ap::mod_proxy::http::handler::write_host_header", 
-+                  AP_HOOK_SIG6(int,ptr,ptr,ptr,int,ptr), 
-+                  AP_HOOK_DECLINE(DECLINED),
-+                  &rc, r, f, desthost, destport, destportstr);
-+        if (rc == DECLINED) {
-+          if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
-+              ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
-+          else
-+              ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
-+        }
-+    }
-+#else /* EAPI */
-     /* Send Host: now, adding it to req_hdrs wouldn't be much better */
-     if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
-         ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF, NULL);
-     else
-         ap_bvputs(f, "Host: ", desthost, CRLF, NULL);
-+#endif /* EAPI */
-     if (conf->viaopt == via_block) {
-         /* Block all outgoing Via: headers */
-
-+---------------------------------------------------------------------------
-| Add EAPI hooks in module structure for APXS generated samples.
-+---------------------------------------------------------------------------
-Index: src/support/apxs.pl
---- src/support/apxs.pl        19 Jun 2002 07:20:34 -0000      1.1.1.12
-+++ src/support/apxs.pl        19 Jun 2002 07:29:09 -0000      1.12
-@@ -711,5 +711,11 @@
-     NULL,                  /* child_init                          */
-     NULL,                  /* child_exit                          */
-     NULL                   /* [#0] post read-request              */
-+#ifdef EAPI
-+   ,NULL,                  /* EAPI: add_module                    */
-+    NULL,                  /* EAPI: remove_module                 */
-+    NULL,                  /* EAPI: rewrite_command               */
-+    NULL                   /* EAPI: new_connection                */
-+#endif
- };
-
-+---------------------------------------------------------------------------
-| Add the EAPI functions, so the stuff can be built under AIX
-| and similar braindead platforms as DSO.
-+---------------------------------------------------------------------------
-Index: src/support/httpd.exp
---- src/support/httpd.exp      19 Jun 2002 07:20:34 -0000      1.1.1.11
-+++ src/support/httpd.exp      19 Jun 2002 07:29:09 -0000      1.13
-@@ -427,3 +427,59 @@
- XML_SetUnparsedEntityDeclHandler
- XML_SetUserData
- XML_UseParserAsHandlerArg
-+ap_add_config_define
-+ap_make_shared_sub_pool
-+ap_global_ctx
-+ap_ctx_new
-+ap_ctx_get
-+ap_ctx_set
-+ap_hook_init
-+ap_hook_kill
-+ap_hook_configure
-+ap_hook_register_I
-+ap_hook_unregister_I
-+ap_hook_status
-+ap_hook_use
-+ap_hook_call
-+ap_mm_useable
-+ap_MM_create
-+ap_MM_permission
-+ap_MM_destroy
-+ap_MM_lock
-+ap_MM_unlock
-+ap_MM_malloc
-+ap_MM_realloc
-+ap_MM_free
-+ap_MM_calloc
-+ap_MM_strdup
-+ap_MM_sizeof
-+ap_MM_maxsize
-+ap_MM_available
-+ap_MM_error
-+ap_mm_create
-+ap_mm_permission
-+ap_mm_destroy
-+ap_mm_lock
-+ap_mm_unlock
-+ap_mm_malloc
-+ap_mm_realloc
-+ap_mm_free
-+ap_mm_calloc
-+ap_mm_strdup
-+ap_mm_sizeof
-+ap_mm_maxsize
-+ap_mm_available
-+ap_mm_error
-+ap_mm_display_info
-+ap_mm_core_create
-+ap_mm_core_permission
-+ap_mm_core_delete
-+ap_mm_core_size
-+ap_mm_core_lock
-+ap_mm_core_unlock
-+ap_mm_core_maxsegsize
-+ap_mm_core_align2page
-+ap_mm_core_align2word
-+ap_mm_lib_error_set
-+ap_mm_lib_error_get
-+ap_mm_lib_version
-
-+---------------------------------------------------------------------------
-| Add the EAPI functions, so the stuff can be built under
-| Windows 95 and similar braindead platforms as DDL.
-+---------------------------------------------------------------------------
-Index: src/ApacheCore.def
---- src/ApacheCore.def 19 Jun 2002 07:20:21 -0000      1.1.1.10
-+++ src/ApacheCore.def 19 Jun 2002 07:29:08 -0000      1.14
-@@ -447,3 +447,67 @@
-         ap_getline @439
-         ap_get_chunk_size @440
-         ap_escape_logitem @441
-+      
-+      ; EAPI extended symbols
-+      ; note; no ID's, so these all bind by name rather than ordinal since 
-+      ; their ordinals would change with symbol changes in the distribution
-+      ap_add_config_define
-+      ap_global_ctx  DATA
-+      ap_ctx_new
-+      ap_ctx_get
-+      ap_ctx_overlay
-+      ap_ctx_set
-+      ap_hook_init
-+      ap_hook_kill
-+      ap_hook_configure
-+      ap_hook_register_I
-+      ap_hook_unregister_I
-+      ap_hook_status
-+      ap_hook_use
-+      ap_hook_call
-+      ap_set_callback_and_alarm
-+      ap_acquire_pool
-+      ap_make_shared_sub_pool
-+      ap_release_pool
-+      ap_mm_useable
-+      ap_MM_create
-+      ap_MM_permission
-+      ap_MM_destroy
-+      ap_MM_lock
-+      ap_MM_unlock
-+      ap_MM_malloc
-+      ap_MM_realloc
-+      ap_MM_free
-+      ap_MM_calloc
-+      ap_MM_strdup
-+      ap_MM_sizeof
-+      ap_MM_maxsize
-+      ap_MM_available
-+      ap_MM_error
-+      ap_mm_create
-+      ap_mm_permission
-+      ap_mm_destroy
-+      ap_mm_lock
-+      ap_mm_unlock
-+      ap_mm_malloc
-+      ap_mm_realloc
-+      ap_mm_free
-+      ap_mm_calloc
-+      ap_mm_strdup
-+      ap_mm_sizeof
-+      ap_mm_maxsize
-+      ap_mm_available
-+      ap_mm_error
-+      ap_mm_display_info
-+      ap_mm_core_create
-+      ap_mm_core_permission
-+      ap_mm_core_delete
-+      ap_mm_core_size
-+      ap_mm_core_lock
-+      ap_mm_core_unlock
-+      ap_mm_core_align2page
-+      ap_mm_core_align2word
-+      ap_mm_lib_error_set
-+      ap_mm_lib_error_get
-+      ap_mm_lib_version
-+
diff --git a/apache-modules_symbols.patch b/apache-modules_symbols.patch
deleted file mode 100644 (file)
index f765789..0000000
+++ /dev/null
@@ -1,1257 +0,0 @@
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_actions.c apache_1.3.14/src/modules/standard/mod_actions.c
---- apache_1.3.14.orig/src/modules/standard/mod_actions.c      Wed Feb  2 21:44:00 2000
-+++ apache_1.3.14/src/modules/standard/mod_actions.c   Sat Nov 11 22:52:25 2000
-@@ -96,34 +96,34 @@
-  * track extension method mappings -- table keys are case-INsensitive.
-  */
- typedef struct {
--    table *action_types;       /* Added with Action... */
-+    table *actions_types;       /* Added with Action... */
-     char *scripted[METHODS];   /* Added with Script... */
-     array_header *xmethods;    /* Added with Script -- extension methods */
--} action_dir_config;
-+} actions_dir_config;
--module action_module;
-+module actions_module;
--static void *create_action_dir_config(pool *p, char *dummy)
-+static void *create_actions_dir_config(pool *p, char *dummy)
- {
--    action_dir_config *new =
--      (action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
-+    actions_dir_config *new =
-+      (actions_dir_config *) ap_palloc(p, sizeof(actions_dir_config));
--    new->action_types = ap_make_table(p, 4);
-+    new->actions_types = ap_make_table(p, 4);
-     memset(new->scripted, 0, sizeof(new->scripted));
-     new->xmethods = ap_make_array(p, 4, sizeof(xmethod_t));
-     return new;
- }
--static void *merge_action_dir_configs(pool *p, void *basev, void *addv)
-+static void *merge_actions_dir_configs(pool *p, void *basev, void *addv)
- {
--    action_dir_config *base = (action_dir_config *) basev;
--    action_dir_config *add = (action_dir_config *) addv;
--    action_dir_config *new = (action_dir_config *) ap_palloc(p,
--                                  sizeof(action_dir_config));
-+    actions_dir_config *base = (actions_dir_config *) basev;
-+    actions_dir_config *add = (actions_dir_config *) addv;
-+    actions_dir_config *new = (actions_dir_config *) ap_palloc(p,
-+                                  sizeof(actions_dir_config));
-     int i;
--    new->action_types = ap_overlay_tables(p, add->action_types,
--                                     base->action_types);
-+    new->actions_types = ap_overlay_tables(p, add->actions_types,
-+                                     base->actions_types);
-     for (i = 0; i < METHODS; ++i) {
-         new->scripted[i] = add->scripted[i] ? add->scripted[i]
-@@ -133,14 +133,14 @@
-     return new;
- }
--static const char *add_action(cmd_parms *cmd, action_dir_config *m, char *type,
-+static const char *add_actions(cmd_parms *cmd, actions_dir_config *m, char *type,
-                             char *script)
- {
--    ap_table_setn(m->action_types, type, script);
-+    ap_table_setn(m->actions_types, type, script);
-     return NULL;
- }
--static const char *set_script(cmd_parms *cmd, action_dir_config *m,
-+static const char *set_script(cmd_parms *cmd, actions_dir_config *m,
-                               char *method, char *script)
- {
-     int methnum;
-@@ -182,20 +182,20 @@
-     return NULL;
- }
--static const command_rec action_cmds[] =
-+static const command_rec actions_cmds[] =
- {
--    {"Action", add_action, NULL, OR_FILEINFO, TAKE2,
-+    {"Action", add_actions, NULL, OR_FILEINFO, TAKE2,
-      "a media type followed by a script name"},
-     {"Script", set_script, NULL, ACCESS_CONF | RSRC_CONF, TAKE2,
-      "a method followed by a script name"},
-     {NULL}
- };
--static int action_handler(request_rec *r)
-+static int actions_handler(request_rec *r)
- {
--    action_dir_config *conf = (action_dir_config *)
--        ap_get_module_config(r->per_dir_config, &action_module);
--    const char *t, *action = r->handler ? r->handler : 
-+    actions_dir_config *conf = (actions_dir_config *)
-+        ap_get_module_config(r->per_dir_config, &actions_module);
-+    const char *t, *actions = r->handler ? r->handler : 
-       ap_field_noparam(r->pool, r->content_type);
-     const char *script;
-     int i;
-@@ -242,9 +242,9 @@
-       return DECLINED;
-     }
--    /* Second, check for actions (which override the method scripts) */
--    if ((t = ap_table_get(conf->action_types,
--                        action ? action : ap_default_type(r)))) {
-+    /* Second, check for actionss (which override the method scripts) */
-+    if ((t = ap_table_get(conf->actions_types,
-+                        actions ? actions : ap_default_type(r)))) {
-       script = t;
-     }
-@@ -260,22 +260,22 @@
-     return OK;
- }
--static const handler_rec action_handlers[] =
-+static const handler_rec actions_handlers[] =
- {
--    {"*/*", action_handler},
-+    {"*/*", actions_handler},
-     {NULL}
- };
--module action_module =
-+module actions_module =
- {
-     STANDARD_MODULE_STUFF,
-     NULL,                     /* initializer */
--    create_action_dir_config, /* dir config creater */
--    merge_action_dir_configs, /* dir merger --- default is to override */
-+    create_actions_dir_config,        /* dir config creater */
-+    merge_actions_dir_configs,        /* dir merger --- default is to override */
-     NULL,                     /* server config */
-     NULL,                     /* merge server config */
--    action_cmds,              /* command table */
--    action_handlers,          /* handlers */
-+    actions_cmds,             /* command table */
-+    actions_handlers,         /* handlers */
-     NULL,                     /* filename translation */
-     NULL,                     /* check_user_id */
-     NULL,                     /* check auth */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_auth_anon.c apache_1.3.14/src/modules/standard/mod_auth_anon.c
---- apache_1.3.14.orig/src/modules/standard/mod_auth_anon.c    Fri Jun  2 01:42:27 2000
-+++ apache_1.3.14/src/modules/standard/mod_auth_anon.c Sat Nov 11 22:52:25 2000
-@@ -114,12 +114,12 @@
-     int auth_anon_mustemail;
-     int auth_anon_authoritative;
--} anon_auth_config_rec;
-+} auth_anon_config_rec;
--static void *create_anon_auth_dir_config(pool *p, char *d)
-+static void *create_auth_anon_dir_config(pool *p, char *d)
- {
--    anon_auth_config_rec *sec = (anon_auth_config_rec *)
--    ap_pcalloc(p, sizeof(anon_auth_config_rec));
-+    auth_anon_config_rec *sec = (auth_anon_config_rec *)
-+    ap_pcalloc(p, sizeof(auth_anon_config_rec));
-     if (!sec)
-       return NULL;            /* no memory... */
-@@ -136,39 +136,39 @@
- }
- static const char *anon_set_passwd_flag(cmd_parms *cmd,
--                               anon_auth_config_rec * sec, int arg)
-+                               auth_anon_config_rec * sec, int arg)
- {
-     sec->auth_anon_mustemail = arg;
-     return NULL;
- }
- static const char *anon_set_userid_flag(cmd_parms *cmd,
--                               anon_auth_config_rec * sec, int arg)
-+                               auth_anon_config_rec * sec, int arg)
- {
-     sec->auth_anon_nouserid = arg;
-     return NULL;
- }
- static const char *anon_set_logemail_flag(cmd_parms *cmd,
--                                 anon_auth_config_rec * sec, int arg)
-+                                 auth_anon_config_rec * sec, int arg)
- {
-     sec->auth_anon_logemail = arg;
-     return NULL;
- }
- static const char *anon_set_verifyemail_flag(cmd_parms *cmd,
--                                    anon_auth_config_rec * sec, int arg)
-+                                    auth_anon_config_rec * sec, int arg)
- {
-     sec->auth_anon_verifyemail = arg;
-     return NULL;
- }
- static const char *anon_set_authoritative_flag(cmd_parms *cmd,
--                                      anon_auth_config_rec * sec, int arg)
-+                                      auth_anon_config_rec * sec, int arg)
- {
-     sec->auth_anon_authoritative = arg;
-     return NULL;
- }
- static const char *anon_set_string_slots(cmd_parms *cmd,
--                                anon_auth_config_rec * sec, char *arg)
-+                                auth_anon_config_rec * sec, char *arg)
- {
-     auth_anon *first;
-@@ -191,7 +191,7 @@
-     return NULL;
- }
--static const command_rec anon_auth_cmds[] =
-+static const command_rec auth_anon_cmds[] =
- {
-     {"Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, ITERATE,
-      "a space-separated list of user IDs"},
-@@ -209,13 +209,13 @@
-     {NULL}
- };
--module MODULE_VAR_EXPORT anon_auth_module;
-+module MODULE_VAR_EXPORT auth_anon_module;
--static int anon_authenticate_basic_user(request_rec *r)
-+static int authenticate_anon_basic_user(request_rec *r)
- {
--    anon_auth_config_rec *sec =
--    (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                             &anon_auth_module);
-+    auth_anon_config_rec *sec =
-+    (auth_anon_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                             &auth_anon_module);
-     conn_rec *c = r->connection;
-     const char *sent_pw;
-     int res = DECLINED;
-@@ -275,9 +275,9 @@
- {
- #ifdef NOTYET
-     conn_rec *c = r->connection;
--    anon_auth_config_rec *sec =
--    (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                             &anon_auth_module);
-+    auth_anon_config_rec *sec =
-+    (auth_anon_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                             &auth_anon_module);
-     if (!sec->auth_anon)
-       return DECLINED;
-@@ -291,18 +291,18 @@
- }
--module MODULE_VAR_EXPORT anon_auth_module =
-+module MODULE_VAR_EXPORT auth_anon_module =
- {
-     STANDARD_MODULE_STUFF,
-     NULL,                     /* initializer */
--    create_anon_auth_dir_config,      /* dir config creater */
-+    create_auth_anon_dir_config,      /* dir config creater */
-     NULL,                     /* dir merger ensure strictness */
-     NULL,                     /* server config */
-     NULL,                     /* merge server config */
--    anon_auth_cmds,           /* command table */
-+    auth_anon_cmds,           /* command table */
-     NULL,                     /* handlers */
-     NULL,                     /* filename translation */
--    anon_authenticate_basic_user,     /* check_user_id */
-+    authenticate_anon_basic_user,     /* check_user_id */
-     check_anon_access,                /* check auth */
-     NULL,                     /* check access */
-     NULL,                     /* type_checker */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_auth_db.c apache_1.3.14/src/modules/standard/mod_auth_db.c
---- apache_1.3.14.orig/src/modules/standard/mod_auth_db.c      Sun Nov 28 13:59:51 1999
-+++ apache_1.3.14/src/modules/standard/mod_auth_db.c   Sat Nov 11 22:52:25 2000
-@@ -72,7 +72,7 @@
-  *           instead of   AuthDBMUserFile    AuthDBMGroupFile
-  *
-  * Also, in the configuration file you need to specify
-- *  db_auth_module rather than dbm_auth_module
-+ *  auth_db_module rather than auth_dbm_module
-  *
-  * On some BSD systems (e.g. FreeBSD and NetBSD) dbm is automatically
-  * mapped to Berkeley DB. You can use either mod_auth_dbm or
-@@ -111,12 +111,12 @@
-     char *auth_dbpwfile;
-     char *auth_dbgrpfile;
-     int auth_dbauthoritative;
--} db_auth_config_rec;
-+} auth_db_config_rec;
--static void *create_db_auth_dir_config(pool *p, char *d)
-+static void *create_auth_db_dir_config(pool *p, char *d)
- {
--    db_auth_config_rec *sec
--    = (db_auth_config_rec *) ap_pcalloc(p, sizeof(db_auth_config_rec));
-+    auth_db_config_rec *sec
-+    = (auth_db_config_rec *) ap_pcalloc(p, sizeof(auth_db_config_rec));
-     sec->auth_dbpwfile = NULL;
-     sec->auth_dbgrpfile = NULL;
-     sec->auth_dbauthoritative = 1;    /* fortress is secure by default */
-@@ -131,28 +131,28 @@
-     return ap_set_file_slot(cmd, offset, f);
- }
--static const command_rec db_auth_cmds[] =
-+static const command_rec auth_db_cmds[] =
- {
-     {"AuthDBUserFile", ap_set_file_slot,
--     (void *) XtOffsetOf(db_auth_config_rec, auth_dbpwfile),
-+     (void *) XtOffsetOf(auth_db_config_rec, auth_dbpwfile),
-      OR_AUTHCFG, TAKE1, NULL},
-     {"AuthDBGroupFile", ap_set_file_slot,
--     (void *) XtOffsetOf(db_auth_config_rec, auth_dbgrpfile),
-+     (void *) XtOffsetOf(auth_db_config_rec, auth_dbgrpfile),
-      OR_AUTHCFG, TAKE1, NULL},
-     {"AuthUserFile", set_db_slot,
--     (void *) XtOffsetOf(db_auth_config_rec, auth_dbpwfile),
-+     (void *) XtOffsetOf(auth_db_config_rec, auth_dbpwfile),
-      OR_AUTHCFG, TAKE12, NULL},
-     {"AuthGroupFile", set_db_slot,
--     (void *) XtOffsetOf(db_auth_config_rec, auth_dbgrpfile),
-+     (void *) XtOffsetOf(auth_db_config_rec, auth_dbgrpfile),
-      OR_AUTHCFG, TAKE12, NULL},
-     {"AuthDBAuthoritative", ap_set_flag_slot,
--     (void *) XtOffsetOf(db_auth_config_rec, auth_dbauthoritative),
-+     (void *) XtOffsetOf(auth_db_config_rec, auth_dbauthoritative),
-      OR_AUTHCFG, FLAG,
-      "Set to 'no' to allow access control to be passed along to lower modules if the userID is not known to this module"},
-     {NULL}
- };
--module db_auth_module;
-+module auth_db_module;
- static char *get_db_pw(request_rec *r, char *user, const char *auth_dbpwfile)
- {
-@@ -226,11 +226,11 @@
-     return grp_data;
- }
--static int db_authenticate_basic_user(request_rec *r)
-+static int authenticate_db_basic_user(request_rec *r)
- {
--    db_auth_config_rec *sec =
--    (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                           &db_auth_module);
-+    auth_db_config_rec *sec =
-+    (auth_db_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                           &auth_db_module);
-     conn_rec *c = r->connection;
-     const char *sent_pw;
-     char *real_pw, *colon_pw;
-@@ -271,9 +271,9 @@
- static int db_check_auth(request_rec *r)
- {
--    db_auth_config_rec *sec =
--    (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                           &db_auth_module);
-+    auth_db_config_rec *sec =
-+    (auth_db_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                           &auth_db_module);
-     char *user = r->connection->user;
-     int m = r->method_number;
-@@ -331,18 +331,18 @@
- }
--module db_auth_module =
-+module auth_db_module =
- {
-     STANDARD_MODULE_STUFF,
-     NULL,                     /* initializer */
--    create_db_auth_dir_config,        /* dir config creater */
-+    create_auth_db_dir_config,        /* dir config creater */
-     NULL,                     /* dir merger --- default is to override */
-     NULL,                     /* server config */
-     NULL,                     /* merge server config */
--    db_auth_cmds,             /* command table */
-+    auth_db_cmds,             /* command table */
-     NULL,                     /* handlers */
-     NULL,                     /* filename translation */
--    db_authenticate_basic_user,       /* check_user_id */
-+    authenticate_db_basic_user,       /* check_user_id */
-     db_check_auth,            /* check auth */
-     NULL,                     /* check access */
-     NULL,                     /* type_checker */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_auth_dbm.c apache_1.3.14/src/modules/standard/mod_auth_dbm.c
---- apache_1.3.14.orig/src/modules/standard/mod_auth_dbm.c     Thu Sep 21 15:19:33 2000
-+++ apache_1.3.14/src/modules/standard/mod_auth_dbm.c  Sat Nov 11 22:56:37 2000
-@@ -92,7 +92,7 @@
-  * instead.
-  *
-  * MODULE-DEFINITION-START
-- * Name: dbm_auth_module
-+ * Name: auth_dbm_module
-  * ConfigStart
-     . ./helpers/find-dbm-lib
-  * ConfigEnd
-@@ -105,12 +105,12 @@
-     char *auth_dbmgrpfile;
-     int auth_dbmauthoritative;
--} dbm_auth_config_rec;
-+} auth_dbm_config_rec;
--static void *create_dbm_auth_dir_config(pool *p, char *d)
-+static void *create_auth_dbm_dir_config(pool *p, char *d)
- {
--    dbm_auth_config_rec *sec
--    = (dbm_auth_config_rec *) ap_pcalloc(p, sizeof(dbm_auth_config_rec));
-+    auth_dbm_config_rec *sec
-+    = (auth_dbm_config_rec *) ap_pcalloc(p, sizeof(auth_dbm_config_rec));
-     sec->auth_dbmpwfile = NULL;
-     sec->auth_dbmgrpfile = NULL;
-@@ -127,27 +127,27 @@
-     return ap_set_file_slot(cmd, offset, f);
- }
--static const command_rec dbm_auth_cmds[] =
-+static const command_rec auth_dbm_cmds[] =
- {
-     {"AuthDBMUserFile", ap_set_file_slot,
--     (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmpwfile),
-+     (void *) XtOffsetOf(auth_dbm_config_rec, auth_dbmpwfile),
-      OR_AUTHCFG, TAKE1, NULL},
-     {"AuthDBMGroupFile", ap_set_file_slot,
--     (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile),
-+     (void *) XtOffsetOf(auth_dbm_config_rec, auth_dbmgrpfile),
-      OR_AUTHCFG, TAKE1, NULL},
-     {"AuthUserFile", set_dbm_slot,
--     (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmpwfile),
-+     (void *) XtOffsetOf(auth_dbm_config_rec, auth_dbmpwfile),
-      OR_AUTHCFG, TAKE12, NULL},
-     {"AuthGroupFile", set_dbm_slot,
--     (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile),
-+     (void *) XtOffsetOf(auth_dbm_config_rec, auth_dbmgrpfile),
-      OR_AUTHCFG, TAKE12, NULL},
-     {"AuthDBMAuthoritative", ap_set_flag_slot,
--     (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmauthoritative),
-+     (void *) XtOffsetOf(auth_dbm_config_rec, auth_dbmauthoritative),
-      OR_AUTHCFG, FLAG, "Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module"},
-     {NULL}
- };
--module MODULE_VAR_EXPORT dbm_auth_module;
-+module MODULE_VAR_EXPORT auth_dbm_module;
- static char *get_dbm_pw(request_rec *r, char *user, char *auth_dbmpwfile)
- {
-@@ -210,11 +210,11 @@
-     return grp_data;
- }
--static int dbm_authenticate_basic_user(request_rec *r)
-+static int authenticate_dbm_basic_user(request_rec *r)
- {
--    dbm_auth_config_rec *sec =
--    (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                            &dbm_auth_module);
-+    auth_dbm_config_rec *sec =
-+    (auth_dbm_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                            &auth_dbm_module);
-     conn_rec *c = r->connection;
-     const char *sent_pw;
-     char *real_pw, *colon_pw;
-@@ -255,9 +255,9 @@
- static int dbm_check_auth(request_rec *r)
- {
--    dbm_auth_config_rec *sec =
--    (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
--                                            &dbm_auth_module);
-+    auth_dbm_config_rec *sec =
-+    (auth_dbm_config_rec *) ap_get_module_config(r->per_dir_config,
-+                                            &auth_dbm_module);
-     char *user = r->connection->user;
-     int m = r->method_number;
-@@ -316,18 +316,18 @@
- }
--module MODULE_VAR_EXPORT dbm_auth_module =
-+module MODULE_VAR_EXPORT auth_dbm_module =
- {
-     STANDARD_MODULE_STUFF,
-     NULL,                     /* initializer */
--    create_dbm_auth_dir_config,       /* dir config creater */
-+    create_auth_dbm_dir_config,       /* dir config creater */
-     NULL,                     /* dir merger --- default is to override */
-     NULL,                     /* server config */
-     NULL,                     /* merge server config */
--    dbm_auth_cmds,            /* command table */
-+    auth_dbm_cmds,            /* command table */
-     NULL,                     /* handlers */
-     NULL,                     /* filename translation */
--    dbm_authenticate_basic_user,      /* check_user_id */
-+    authenticate_dbm_basic_user,      /* check_user_id */
-     dbm_check_auth,           /* check auth */
-     NULL,                     /* check access */
-     NULL,                     /* type_checker */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_include.c apache_1.3.14/src/modules/standard/mod_include.c
---- apache_1.3.14.orig/src/modules/standard/mod_include.c      Fri Sep 22 20:26:32 2000
-+++ apache_1.3.14/src/modules/standard/mod_include.c   Sat Nov 11 22:52:25 2000
-@@ -106,7 +106,7 @@
- #define RAW_ASCII_CHAR(ch)  (ch)
- #endif /*CHARSET_EBCDIC*/
--module MODULE_VAR_EXPORT includes_module;
-+module MODULE_VAR_EXPORT include_module;
- /* ------------------------ Environment function -------------------------- */
-@@ -733,7 +733,7 @@
-           /* see the Kludge in send_parsed_file for why */
-           if (rr) 
--              ap_set_module_config(rr->request_config, &includes_module, r);
-+              ap_set_module_config(rr->request_config, &include_module, r);
-             if (!error_fmt && ap_run_sub_req(rr)) {
-                 error_fmt = "unable to include \"%s\" in parsed file %s";
-@@ -2311,7 +2311,7 @@
-  * option only changes the default.
-  */
--module includes_module;
-+module include_module;
- enum xbithack {
-     xbithack_off, xbithack_on, xbithack_full
- };
-@@ -2322,7 +2322,7 @@
- #define DEFAULT_XBITHACK xbithack_off
- #endif
--static void *create_includes_dir_config(pool *p, char *dummy)
-+static void *create_include_dir_config(pool *p, char *dummy)
- {
-     enum xbithack *result = (enum xbithack *) ap_palloc(p, sizeof(enum xbithack));
-     *result = DEFAULT_XBITHACK;
-@@ -2353,7 +2353,7 @@
- {
-     FILE *f;
-     enum xbithack *state =
--    (enum xbithack *) ap_get_module_config(r->per_dir_config, &includes_module);
-+    (enum xbithack *) ap_get_module_config(r->per_dir_config, &include_module);
-     int errstatus;
-     request_rec *parent;
-@@ -2424,7 +2424,7 @@
-       while (q) {
-           if (ap_table_get(q->notes, PARENT_STRING)) {
-               /* Kludge --- See below */
--              ap_set_module_config(r->request_config, &includes_module, q);
-+              ap_set_module_config(r->request_config, &include_module, q);
-               /* Create the initial environment in the parent */
-               ap_add_common_vars(q);
-@@ -2446,7 +2446,7 @@
-       }
-     }
--    if ((parent = ap_get_module_config(r->request_config, &includes_module))) {
-+    if ((parent = ap_get_module_config(r->request_config, &include_module))) {
-       /* Kludge --- for nested includes, we want to keep the subprocess
-        * environment of the base document (for compatibility); that means
-        * torquing our own last_modified date as well so that the
-@@ -2516,7 +2516,7 @@
-     }
-     state = (enum xbithack *) ap_get_module_config(r->per_dir_config,
--                                                &includes_module);
-+                                                &include_module);
-     if (*state == xbithack_off) {
-         return DECLINED;
-@@ -2525,13 +2525,13 @@
- #endif
- }
--static const command_rec includes_cmds[] =
-+static const command_rec include_cmds[] =
- {
-     {"XBitHack", set_xbithack, NULL, OR_OPTIONS, TAKE1, "Off, On, or Full"},
-     {NULL}
- };
--static const handler_rec includes_handlers[] =
-+static const handler_rec include_handlers[] =
- {
-     {INCLUDES_MAGIC_TYPE, send_shtml_file},
-     {INCLUDES_MAGIC_TYPE3, send_shtml_file},
-@@ -2540,16 +2540,16 @@
-     {NULL}
- };
--module MODULE_VAR_EXPORT includes_module =
-+module MODULE_VAR_EXPORT include_module =
- {
-     STANDARD_MODULE_STUFF,
-     NULL,                       /* initializer */
--    create_includes_dir_config, /* dir config creater */
-+    create_include_dir_config,  /* dir config creater */
-     NULL,                       /* dir merger --- default is to override */
-     NULL,                       /* server config */
-     NULL,                       /* merge server config */
--    includes_cmds,              /* command table */
--    includes_handlers,          /* handlers */
-+    include_cmds,               /* command table */
-+    include_handlers,           /* handlers */
-     NULL,                       /* filename translation */
-     NULL,                       /* check_user_id */
-     NULL,                       /* check auth */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_log_agent.c apache_1.3.14/src/modules/standard/mod_log_agent.c
---- apache_1.3.14.orig/src/modules/standard/mod_log_agent.c    Fri Jan  1 20:05:10 1999
-+++ apache_1.3.14/src/modules/standard/mod_log_agent.c Sat Nov 11 22:52:25 2000
-@@ -60,7 +60,7 @@
- #include "http_config.h"
- #include "http_log.h"
--module agent_log_module;
-+module log_agent_module;
- static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
- #ifdef OS2
-@@ -73,12 +73,12 @@
- typedef struct {
-     char *fname;
-     int agent_fd;
--} agent_log_state;
-+} log_agent_state;
--static void *make_agent_log_state(pool *p, server_rec *s)
-+static void *make_log_agent_state(pool *p, server_rec *s)
- {
--    agent_log_state *cls =
--    (agent_log_state *) ap_palloc(p, sizeof(agent_log_state));
-+    log_agent_state *cls =
-+    (log_agent_state *) ap_palloc(p, sizeof(log_agent_state));
-     cls->fname = "";
-     cls->agent_fd = -1;
-@@ -86,26 +86,26 @@
-     return (void *) cls;
- }
--static const char *set_agent_log(cmd_parms *parms, void *dummy, char *arg)
-+static const char *set_log_agent(cmd_parms *parms, void *dummy, char *arg)
- {
--    agent_log_state *cls = ap_get_module_config(parms->server->module_config,
--                                             &agent_log_module);
-+    log_agent_state *cls = ap_get_module_config(parms->server->module_config,
-+                                             &log_agent_module);
-     cls->fname = arg;
-     return NULL;
- }
--static const command_rec agent_log_cmds[] =
-+static const command_rec log_agent_cmds[] =
- {
--    {"AgentLog", set_agent_log, NULL, RSRC_CONF, TAKE1,
-+    {"AgentLog", set_log_agent, NULL, RSRC_CONF, TAKE1,
-      "the filename of the agent log"},
-     {NULL}
- };
--static void open_agent_log(server_rec *s, pool *p)
-+static void open_log_agent(server_rec *s, pool *p)
- {
--    agent_log_state *cls = ap_get_module_config(s->module_config,
--                                             &agent_log_module);
-+    log_agent_state *cls = ap_get_module_config(s->module_config,
-+                                             &log_agent_module);
-     char *fname = ap_server_root_relative(p, cls->fname);
-@@ -132,16 +132,16 @@
-     }
- }
--static void init_agent_log(server_rec *s, pool *p)
-+static void init_log_agent(server_rec *s, pool *p)
- {
-     for (; s; s = s->next)
--        open_agent_log(s, p);
-+        open_log_agent(s, p);
- }
--static int agent_log_transaction(request_rec *orig)
-+static int log_agent_transaction(request_rec *orig)
- {
--    agent_log_state *cls = ap_get_module_config(orig->server->module_config,
--                                             &agent_log_module);
-+    log_agent_state *cls = ap_get_module_config(orig->server->module_config,
-+                                             &log_agent_module);
-     char str[HUGE_STRING_LEN];
-     const char *agent;
-@@ -164,15 +164,15 @@
-     return OK;
- }
--module agent_log_module =
-+module log_agent_module =
- {
-     STANDARD_MODULE_STUFF,
--    init_agent_log,             /* initializer */
-+    init_log_agent,             /* initializer */
-     NULL,                       /* create per-dir config */
-     NULL,                       /* merge per-dir config */
--    make_agent_log_state,       /* server config */
-+    make_log_agent_state,       /* server config */
-     NULL,                       /* merge server config */
--    agent_log_cmds,             /* command table */
-+    log_agent_cmds,             /* command table */
-     NULL,                       /* handlers */
-     NULL,                       /* filename translation */
-     NULL,                       /* check_user_id */
-@@ -180,7 +180,7 @@
-     NULL,                       /* check access */
-     NULL,                       /* type_checker */
-     NULL,                       /* fixups */
--    agent_log_transaction,      /* logger */
-+    log_agent_transaction,      /* logger */
-     NULL,                       /* header parser */
-     NULL,                       /* child_init */
-     NULL,                       /* child_exit */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_log_config.c apache_1.3.14/src/modules/standard/mod_log_config.c
---- apache_1.3.14.orig/src/modules/standard/mod_log_config.c   Sat Nov 11 22:51:24 2000
-+++ apache_1.3.14/src/modules/standard/mod_log_config.c        Sat Nov 11 22:52:25 2000
-@@ -180,7 +180,7 @@
- #include "http_log.h"
- #include <limits.h>
--module MODULE_VAR_EXPORT config_log_module;
-+module MODULE_VAR_EXPORT log_config_module;
- static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
- #if defined(OS2) || defined(WIN32) || defined(NETWARE)
-@@ -207,29 +207,29 @@
- /*
-  * multi_log_state is our per-(virtual)-server configuration. We store
-- * an array of the logs we are going to use, each of type config_log_state.
-+ * an array of the logs we are going to use, each of type log_config_state.
-  * If a default log format is given by LogFormat, store in default_format
-  * (backward compat. with mod_log_config).  We also store for each virtual
-  * server a pointer to the logs specified for the main server, so that if this
-  * vhost has no logs defined, we can use the main server's logs instead.
-  *
-- * So, for the main server, config_logs contains a list of the log files
-- * and server_config_logs in empty. For a vhost, server_config_logs
-- * points to the same array as config_logs in the main server, and
-- * config_logs points to the array of logs defined inside this vhost,
-+ * So, for the main server, log_configs contains a list of the log files
-+ * and server_log_configs in empty. For a vhost, server_log_configs
-+ * points to the same array as log_configs in the main server, and
-+ * log_configs points to the array of logs defined inside this vhost,
-  * which might be empty.
-  */
- typedef struct {
-     char *default_format_string;
-     array_header *default_format;
--    array_header *config_logs;
--    array_header *server_config_logs;
-+    array_header *log_configs;
-+    array_header *server_log_configs;
-     table *formats;
- } multi_log_state;
- /*
-- * config_log_state holds the status of a single log file. fname might
-+ * log_config_state holds the status of a single log file. fname might
-  * be NULL, which means this module does no logging for this
-  * request. format might be NULL, in which case the default_format
-  * from the multi_log_state should be used, or if that is NULL as
-@@ -247,7 +247,7 @@
-     int outcnt;
-     char outbuf[LOG_BUFSIZE];
- #endif
--} config_log_state;
-+} log_config_state;
- /*
-  * Format items...
-@@ -803,7 +803,7 @@
- }
- #ifdef BUFFERED_LOGS
--static void flush_log(config_log_state *cls)
-+static void flush_log(log_config_state *cls)
- {
-     if (cls->outcnt && cls->log_fd != -1) {
-         write(cls->log_fd, cls->outbuf, cls->outcnt);
-@@ -812,7 +812,7 @@
- }
- #endif
--static int config_log_transaction(request_rec *r, config_log_state *cls,
-+static int log_config_transaction(request_rec *r, log_config_state *cls,
-                                   array_header *default_format)
- {
-     log_format_item *items;
-@@ -905,27 +905,27 @@
- static int multi_log_transaction(request_rec *r)
- {
-     multi_log_state *mls = ap_get_module_config(r->server->module_config,
--                                              &config_log_module);
--    config_log_state *clsarray;
-+                                              &log_config_module);
-+    log_config_state *clsarray;
-     int i;
-     /*
-      * Log this transaction..
-      */
--    if (mls->config_logs->nelts) {
--        clsarray = (config_log_state *) mls->config_logs->elts;
--        for (i = 0; i < mls->config_logs->nelts; ++i) {
--            config_log_state *cls = &clsarray[i];
-+    if (mls->log_configs->nelts) {
-+        clsarray = (log_config_state *) mls->log_configs->elts;
-+        for (i = 0; i < mls->log_configs->nelts; ++i) {
-+            log_config_state *cls = &clsarray[i];
--            config_log_transaction(r, cls, mls->default_format);
-+            log_config_transaction(r, cls, mls->default_format);
-         }
-     }
--    else if (mls->server_config_logs) {
--        clsarray = (config_log_state *) mls->server_config_logs->elts;
--        for (i = 0; i < mls->server_config_logs->nelts; ++i) {
--            config_log_state *cls = &clsarray[i];
-+    else if (mls->server_log_configs) {
-+        clsarray = (log_config_state *) mls->server_log_configs->elts;
-+        for (i = 0; i < mls->server_log_configs->nelts; ++i) {
-+            log_config_state *cls = &clsarray[i];
--            config_log_transaction(r, cls, mls->default_format);
-+            log_config_transaction(r, cls, mls->default_format);
-         }
-     }
-@@ -937,15 +937,15 @@
-  * Module glue...
-  */
--static void *make_config_log_state(pool *p, server_rec *s)
-+static void *make_log_config_state(pool *p, server_rec *s)
- {
-     multi_log_state *mls;
-     mls = (multi_log_state *) ap_palloc(p, sizeof(multi_log_state));
--    mls->config_logs = ap_make_array(p, 1, sizeof(config_log_state));
-+    mls->log_configs = ap_make_array(p, 1, sizeof(log_config_state));
-     mls->default_format_string = NULL;
-     mls->default_format = NULL;
--    mls->server_config_logs = NULL;
-+    mls->server_log_configs = NULL;
-     mls->formats = ap_make_table(p, 4);
-     ap_table_setn(mls->formats, "CLF", DEFAULT_LOG_FORMAT);
-@@ -958,12 +958,12 @@
-  * vhosts inherit any globally-defined format names.
-  */
--static void *merge_config_log_state(pool *p, void *basev, void *addv)
-+static void *merge_log_config_state(pool *p, void *basev, void *addv)
- {
-     multi_log_state *base = (multi_log_state *) basev;
-     multi_log_state *add = (multi_log_state *) addv;
--    add->server_config_logs = base->config_logs;
-+    add->server_log_configs = base->log_configs;
-     if (!add->default_format) {
-         add->default_format_string = base->default_format_string;
-         add->default_format = base->default_format;
-@@ -981,7 +981,7 @@
- {
-     const char *err_string = NULL;
-     multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
--                                              &config_log_module);
-+                                              &log_config_module);
-     /*
-      * If we were given two arguments, the second is a name to be given to the
-@@ -1007,10 +1007,10 @@
- {
-     const char *err_string = NULL;
-     multi_log_state *mls = ap_get_module_config(cmd->server->module_config,
--                                              &config_log_module);
--    config_log_state *cls;
-+                                              &log_config_module);
-+    log_config_state *cls;
--    cls = (config_log_state *) ap_push_array(mls->config_logs);
-+    cls = (log_config_state *) ap_push_array(mls->log_configs);
-     cls->condition_var = NULL;
-     if (envclause != NULL) {
-       if (strncasecmp(envclause, "env=", 4) != 0) {
-@@ -1046,7 +1046,7 @@
-     return add_custom_log(cmd, dummy, fn, "%{Cookie}n \"%r\" %t", NULL);
- }
--static const command_rec config_log_cmds[] =
-+static const command_rec log_config_cmds[] =
- {
-     {"CustomLog", add_custom_log, NULL, RSRC_CONF, TAKE23,
-      "a file name, a custom log format string or format name, "
-@@ -1060,8 +1060,8 @@
-     {NULL}
- };
--static config_log_state *open_config_log(server_rec *s, pool *p,
--                                         config_log_state *cls,
-+static log_config_state *open_log_config(server_rec *s, pool *p,
-+                                         log_config_state *cls,
-                                          array_header *default_format)
- {
-     if (cls->log_fd > 0) {
-@@ -1096,12 +1096,12 @@
-     return cls;
- }
--static config_log_state *open_multi_logs(server_rec *s, pool *p)
-+static log_config_state *open_multi_logs(server_rec *s, pool *p)
- {
-     int i;
-     multi_log_state *mls = ap_get_module_config(s->module_config,
--                                             &config_log_module);
--    config_log_state *clsarray;
-+                                             &log_config_module);
-+    log_config_state *clsarray;
-     const char *dummy;
-     const char *format;
-@@ -1116,10 +1116,10 @@
-         mls->default_format = parse_log_string(p, DEFAULT_LOG_FORMAT, &dummy);
-     }
--    if (mls->config_logs->nelts) {
--        clsarray = (config_log_state *) mls->config_logs->elts;
--        for (i = 0; i < mls->config_logs->nelts; ++i) {
--            config_log_state *cls = &clsarray[i];
-+    if (mls->log_configs->nelts) {
-+        clsarray = (log_config_state *) mls->log_configs->elts;
-+        for (i = 0; i < mls->log_configs->nelts; ++i) {
-+            log_config_state *cls = &clsarray[i];
-           if (cls->format_string) {
-               format = ap_table_get(mls->formats, cls->format_string);
-@@ -1128,13 +1128,13 @@
-               }
-           }
--            cls = open_config_log(s, p, cls, mls->default_format);
-+            cls = open_log_config(s, p, cls, mls->default_format);
-         }
-     }
--    else if (mls->server_config_logs) {
--        clsarray = (config_log_state *) mls->server_config_logs->elts;
--        for (i = 0; i < mls->server_config_logs->nelts; ++i) {
--            config_log_state *cls = &clsarray[i];
-+    else if (mls->server_log_configs) {
-+        clsarray = (log_config_state *) mls->server_log_configs->elts;
-+        for (i = 0; i < mls->server_log_configs->nelts; ++i) {
-+            log_config_state *cls = &clsarray[i];
-           if (cls->format_string) {
-               format = ap_table_get(mls->formats, cls->format_string);
-@@ -1143,14 +1143,14 @@
-               }
-           }
--            cls = open_config_log(s, p, cls, mls->default_format);
-+            cls = open_log_config(s, p, cls, mls->default_format);
-         }
-     }
-     return NULL;
- }
--static void init_config_log(server_rec *s, pool *p)
-+static void init_log_config(server_rec *s, pool *p)
- {
-     /* First, do "physical" server, which gets default log fd and format
-      * for the virtual servers, if they don't override...
-@@ -1170,20 +1170,20 @@
- {
-     multi_log_state *mls;
-     array_header *log_list;
--    config_log_state *clsarray;
-+    log_config_state *clsarray;
-     int i;
-     for (; s; s = s->next) {
--        mls = ap_get_module_config(s->module_config, &config_log_module);
-+        mls = ap_get_module_config(s->module_config, &log_config_module);
-         log_list = NULL;
--        if (mls->config_logs->nelts) {
--            log_list = mls->config_logs;
-+        if (mls->log_configs->nelts) {
-+            log_list = mls->log_configs;
-         }
--        else if (mls->server_config_logs) {
--            log_list = mls->server_config_logs;
-+        else if (mls->server_log_configs) {
-+            log_list = mls->server_log_configs;
-         }
-         if (log_list) {
--            clsarray = (config_log_state *) log_list->elts;
-+            clsarray = (log_config_state *) log_list->elts;
-             for (i = 0; i < log_list->nelts; ++i) {
-                 flush_log(&clsarray[i]);
-             }
-@@ -1192,15 +1192,15 @@
- }
- #endif
--module MODULE_VAR_EXPORT config_log_module =
-+module MODULE_VAR_EXPORT log_config_module =
- {
-     STANDARD_MODULE_STUFF,
--    init_config_log,            /* initializer */
-+    init_log_config,            /* initializer */
-     NULL,                       /* create per-dir config */
-     NULL,                       /* merge per-dir config */
--    make_config_log_state,      /* server config */
--    merge_config_log_state,     /* merge server config */
--    config_log_cmds,            /* command table */
-+    make_log_config_state,      /* server config */
-+    merge_log_config_state,     /* merge server config */
-+    log_config_cmds,            /* command table */
-     NULL,                       /* handlers */
-     NULL,                       /* filename translation */
-     NULL,                       /* check_user_id */
-diff -urN apache_1.3.14.orig/src/modules/standard/mod_log_referer.c apache_1.3.14/src/modules/standard/mod_log_referer.c
---- apache_1.3.14.orig/src/modules/standard/mod_log_referer.c  Fri Jan  1 20:05:11 1999
-+++ apache_1.3.14/src/modules/standard/mod_log_referer.c       Sat Nov 11 22:52:25 2000
-@@ -60,7 +60,7 @@
- #include "http_config.h"
- #include "http_log.h"
--module referer_log_module;
-+module log_referer_module;
- static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
-@@ -75,12 +75,12 @@
-     char *fname;
-     int referer_fd;
-     array_header *referer_ignore_list;
--} referer_log_state;
-+} log_referer_state;
--static void *make_referer_log_state(pool *p, server_rec *s)
-+static void *make_log_referer_state(pool *p, server_rec *s)
- {
--    referer_log_state *cls =
--    (referer_log_state *) ap_palloc(p, sizeof(referer_log_state));
-+    log_referer_state *cls =
-+    (log_referer_state *) ap_palloc(p, sizeof(log_referer_state));
-     cls->fname = "";
-     cls->referer_fd = -1;
-@@ -88,10 +88,10 @@
-     return (void *) cls;
- }
--static const char *set_referer_log(cmd_parms *parms, void *dummy, char *arg)
-+static const char *set_log_referer(cmd_parms *parms, void *dummy, char *arg)
- {
--    referer_log_state *cls = ap_get_module_config(parms->server->module_config,
--                                               &referer_log_module);
-+    log_referer_state *cls = ap_get_module_config(parms->server->module_config,
-+                                               &log_referer_module);
-     cls->fname = arg;
-     return NULL;
-@@ -100,8 +100,8 @@
- static const char *add_referer_ignore(cmd_parms *parms, void *dummy, char *arg)
- {
-     char **addme;
--    referer_log_state *cls = ap_get_module_config(parms->server->module_config,
--                                               &referer_log_module);
-+    log_referer_state *cls = ap_get_module_config(parms->server->module_config,
-+                                               &log_referer_module);
-     addme = ap_push_array(cls->referer_ignore_list);
-     ap_str_tolower(arg);
-@@ -109,19 +109,19 @@
-     return NULL;
- }
--static const command_rec referer_log_cmds[] =
-+static const command_rec log_referer_cmds[] =
- {
--    {"RefererLog", set_referer_log, NULL, RSRC_CONF, TAKE1,
-+    {"RefererLog", set_log_referer, NULL, RSRC_CONF, TAKE1,
-      "the filename of the referer log"},
-     {"RefererIgnore", add_referer_ignore, NULL, RSRC_CONF, ITERATE,
-      "referer hostnames to ignore"},
-     {NULL}
- };
--static void open_referer_log(server_rec *s, pool *p)
-+static void open_log_referer(server_rec *s, pool *p)
- {
--    referer_log_state *cls = ap_get_module_config(s->module_config,
--                                               &referer_log_module);
-+    log_referer_state *cls = ap_get_module_config(s->module_config,
-+                                               &log_referer_module);
-     char *fname = ap_server_root_relative(p, cls->fname);
-@@ -149,17 +149,17 @@
-     }
- }
--static void init_referer_log(server_rec *s, pool *p)
-+static void init_log_referer(server_rec *s, pool *p)
- {
-     for (; s; s = s->next)
--        open_referer_log(s, p);
-+        open_log_referer(s, p);
- }
--static int referer_log_transaction(request_rec *orig)
-+static int log_referer_transaction(request_rec *orig)
- {
-     char **ptrptr, **ptrptr2;
--    referer_log_state *cls = ap_get_module_config(orig->server->module_config,
--                                               &referer_log_module);
-+    log_referer_state *cls = ap_get_module_config(orig->server->module_config,
-+                                               &log_referer_module);
-     char *str;
-     const char *referer;
-@@ -205,15 +205,15 @@
-     return OK;
- }
--module referer_log_module =
-+module log_referer_module =
- {
-     STANDARD_MODULE_STUFF,
--    init_referer_log,           /* initializer */
-+    init_log_referer,           /* initializer */
-     NULL,                       /* create per-dir config */
-     NULL,                       /* merge per-dir config */
--    make_referer_log_state,     /* server config */
-+    make_log_referer_state,     /* server config */
-     NULL,                       /* merge server config */
--    referer_log_cmds,           /* command table */
-+    log_referer_cmds,           /* command table */
-     NULL,                       /* handlers */
-     NULL,                       /* filename translation */
-     NULL,                       /* check_user_id */
-@@ -221,7 +221,7 @@
-     NULL,                       /* check access */
-     NULL,                       /* type_checker */
-     NULL,                       /* fixups */
--    referer_log_transaction,    /* logger */
-+    log_referer_transaction,    /* logger */
-     NULL,                       /* header parser */
-     NULL,                       /* child_init */
-     NULL,                       /* child_exit */
---- apache_1.3.23/src/modules/experimental/mod_auth_digest.c.orig      Thu Feb  8 00:43:50 2001
-+++ apache_1.3.23/src/modules/experimental/mod_auth_digest.c   Mon Mar  4 22:30:20 2002
-@@ -97,7 +97,7 @@
- /* The section for the Configure script:
-  * MODULE-DEFINITION-START
-- * Name: digest_auth_module
-+ * Name: auth_digest_module
-  * ConfigStart
-     RULE_DEV_RANDOM=`./helpers/CutRule DEV_RANDOM $file`
-@@ -262,7 +262,7 @@
- static void          *client_mm = NULL;
- #endif        /* HAVE_SHMEM_MM */
--module MODULE_VAR_EXPORT digest_auth_module;
-+module MODULE_VAR_EXPORT auth_digest_module;
- /*
-  * initialization code
-@@ -963,7 +963,7 @@
-     resp->raw_request_uri = r->unparsed_uri;
-     resp->psd_request_uri = &r->parsed_uri;
-     resp->needed_auth = 0;
--    ap_set_module_config(r->request_config, &digest_auth_module, resp);
-+    ap_set_module_config(r->request_config, &auth_digest_module, resp);
-     res = get_digest_rec(r, resp);
-     resp->client = get_client(resp->opaque_num, r);
-@@ -1606,14 +1606,14 @@
-     while (mainreq->main != NULL)  mainreq = mainreq->main;
-     while (mainreq->prev != NULL)  mainreq = mainreq->prev;
-     resp = (digest_header_rec *) ap_get_module_config(mainreq->request_config,
--                                                    &digest_auth_module);
-+                                                    &auth_digest_module);
-     resp->needed_auth = 1;
-     /* get our conf */
-     conf = (digest_config_rec *) ap_get_module_config(r->per_dir_config,
--                                                    &digest_auth_module);
-+                                                    &auth_digest_module);
-     /* check for existence and syntax of Auth header */
-@@ -1839,7 +1839,7 @@
- {
-     const digest_config_rec *conf =
-               (digest_config_rec *) ap_get_module_config(r->per_dir_config,
--                                                         &digest_auth_module);
-+                                                         &auth_digest_module);
-     const char *user = r->connection->user;
-     int m = r->method_number;
-     int method_restricted = 0;
-@@ -1909,7 +1909,7 @@
-     note_digest_auth_failure(r, conf,
-       (digest_header_rec *) ap_get_module_config(r->request_config,
--                                                 &digest_auth_module),
-+                                                 &auth_digest_module),
-       0);
-     return AUTH_REQUIRED;
- }
-@@ -1934,10 +1934,10 @@
- {
-     const digest_config_rec *conf =
-               (digest_config_rec *) ap_get_module_config(r->per_dir_config,
--                                                         &digest_auth_module);
-+                                                         &auth_digest_module);
-     digest_header_rec *resp =
-               (digest_header_rec *) ap_get_module_config(r->request_config,
--                                                         &digest_auth_module);
-+                                                         &auth_digest_module);
-     const char *ai = NULL, *digest = NULL, *nextnonce = "";
-     if (resp == NULL || !resp->needed_auth || conf == NULL)
-@@ -2076,7 +2076,7 @@
- }
--module MODULE_VAR_EXPORT digest_auth_module =
-+module MODULE_VAR_EXPORT auth_digest_module =
- {
-     STANDARD_MODULE_STUFF,
-     initialize_module,                /* initializer */
This page took 0.826413 seconds and 4 git commands to generate.