diff options
-rw-r--r-- | www/apache/Makefile | 4 | ||||
-rw-r--r-- | www/apache/files/ap_include_extern.h | 8 | ||||
-rw-r--r-- | www/apache/patches/patch-af | 98 |
3 files changed, 37 insertions, 73 deletions
diff --git a/www/apache/Makefile b/www/apache/Makefile index aaef885333e..7b30b3eae82 100644 --- a/www/apache/Makefile +++ b/www/apache/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.25 1998/12/03 17:23:52 tv Exp $ +# $NetBSD: Makefile,v 1.26 1998/12/03 22:26:52 tv Exp $ # # The fourth number in the PKGNAME version indicates a NetBSD pkg revision # (to indicate changes in the shipped third party patches such as the mod_ssl @@ -9,7 +9,7 @@ # DISTNAME= apache_1.3.3 -PKGNAME= apache-1.3.3.0 +PKGNAME= apache-1.3.3.1 CATEGORIES= www MASTER_SITES= http://www.apache.org/dist/ \ http://www.engelschall.com/sw/mod_ssl/distrib/ \ diff --git a/www/apache/files/ap_include_extern.h b/www/apache/files/ap_include_extern.h index b7a36b2b8c7..6d820c47f8a 100644 --- a/www/apache/files/ap_include_extern.h +++ b/www/apache/files/ap_include_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: ap_include_extern.h,v 1.1 1998/12/03 17:23:52 tv Exp $ */ +/* $NetBSD: ap_include_extern.h,v 1.2 1998/12/03 22:26:53 tv Exp $ */ /* ==================================================================== * Copyright (c) 1998 The Apache Group. All rights reserved. * @@ -70,9 +70,13 @@ typedef int (*ap_include_extern_func)(FILE *, request_rec *, const char *); /* The const char * argument is the command word used to find this hook. */ -API_EXPORT(int) ap_register_include_extern(const char *, ap_include_extern_func); +API_EXPORT(int) ap_include_register_extern(const char *, ap_include_extern_func); /* Formerly a static "get_tag()" in mod_include.c */ API_EXPORT(char *) ap_include_get_tag(pool *, FILE *, char *, int, int); +/* Formerly a static "parse_string()" in mod_include.c */ +API_EXPORT(void) ap_include_parse_string(request_rec *, const char *, + char *, size_t, int); + #endif diff --git a/www/apache/patches/patch-af b/www/apache/patches/patch-af index e702eea2084..b16c6c88b6c 100644 --- a/www/apache/patches/patch-af +++ b/www/apache/patches/patch-af @@ -1,31 +1,20 @@ -$NetBSD: patch-af,v 1.1 1998/12/03 17:23:53 tv Exp $ +$NetBSD: patch-af,v 1.2 1998/12/03 22:26:53 tv Exp $ --- src/modules/standard/mod_include.c.orig Thu Sep 24 10:06:42 1998 -+++ src/modules/standard/mod_include.c Wed Dec 2 10:36:06 1998 -@@ -92,7 +92,9 @@ ++++ src/modules/standard/mod_include.c Thu Dec 3 17:24:12 1998 +@@ -92,7 +92,11 @@ #include "http_log.h" #include "http_main.h" #include "util_script.h" +#include "ap_include_extern.h" ++#include "ap_hook.h" #endif +#define get_tag ap_include_get_tag ++#define parse_string ap_include_parse_string #define STARTING_SEQUENCE "<!--#" #define ENDING_SEQUENCE "-->" -@@ -111,6 +113,12 @@ - /* just need some arbitrary non-NULL pointer which can't also be a request_rec */ - #define NESTED_INCLUDE_MAGIC (&includes_module) - -+static struct extern_handler { -+ struct extern_handler *next; -+ char cmd[20]; -+ ap_include_extern_func func; -+} *extern_handlers; -+ - /* ------------------------ Environment function -------------------------- */ - - /* XXX: could use ap_table_overlap here */ -@@ -354,7 +362,8 @@ +@@ -354,7 +358,8 @@ * the tag value is html decoded if dodecode is non-zero */ @@ -35,71 +24,42 @@ $NetBSD: patch-af,v 1.1 1998/12/03 17:23:53 tv Exp $ { char *t = tag, *tag_val, c, term; -@@ -2090,6 +2099,50 @@ +@@ -473,7 +478,7 @@ + /* + * Do variable substitution on strings + */ +-static void parse_string(request_rec *r, const char *in, char *out, ++API_EXPORT(void) ap_include_parse_string(request_rec *r, const char *in, char *out, + size_t length, int leave_name) + { + char ch; +@@ -2090,6 +2095,16 @@ } } +API_EXPORT(int) -+ap_register_include_extern(const char *cmd, ap_include_extern_func func) { -+ struct extern_handler *h; ++ap_include_register_extern(const char *cmd, ap_include_extern_func func) { ++ char cmdbuf[40] = "include::"; + -+ for (h = extern_handlers; h; h = h->next) -+ if (!strncmp(h->cmd, cmd, 20)) -+ return -1; -+ if (!(h = calloc(1, sizeof(*h)))) -+ return -1; ++ strncat(cmdbuf, cmd, 30); ++ ap_hook_configure(cmdbuf, AP_HOOK_SIG4(int,ptr,ptr,ptr), AP_HOOK_DECLINE(-32767)); ++ ap_hook_register(cmdbuf, func, NULL); + -+ h->next = extern_handlers; -+ strncpy(h->cmd, cmd, 20); -+ h->func = func; -+ extern_handlers = h; + return 0; +} -+ -+/* -+ * Since we should be compiled in, dynamic modules will all initialize -+ * _after_ us. This assumption breaks if mod_includes is made dynamic, -+ * or if modules using ap_register_include_extern() are compiled in. -+ */ -+static void includes_init(server_rec *s, pool *p) { -+ struct extern_handler *h, *n; -+ -+ for (h = extern_handlers; h; h = n) { -+ n = h->next; -+ free(h); -+ } -+ extern_handlers = NULL; -+} -+ -+static int do_externs(FILE *in, request_rec *r, const char *error, -+ const char *cmd, int *ret) { -+ struct extern_handler *h; -+ -+ for (h = extern_handlers; h; h = h->next) -+ if (!strncmp(h->cmd, cmd, 20)) { -+ *ret = (*h->func)(in, r, error); -+ return 0; -+ } -+ return -1; -+} -+ /* -------------------------- The main function --------------------------- */ -@@ -2213,6 +2266,7 @@ - ret = handle_perl(f, r, error); +@@ -2214,6 +2229,12 @@ } #endif -+ else if (!do_externs(f, r, error, directive, &ret)) {} else { ++ char cmdbuf[40] = "include::"; ++ ++ strncat(cmdbuf, directive, 30); ++ if (ap_hook_call(cmdbuf, &ret, f, r, error) == TRUE) ++ continue; ++ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, "httpd: unknown directive \"%s\" " -@@ -2420,7 +2474,7 @@ - module MODULE_VAR_EXPORT includes_module = - { - STANDARD_MODULE_STUFF, -- NULL, /* initializer */ -+ includes_init, /* initializer */ - create_includes_dir_config, /* dir config creater */ - NULL, /* dir merger --- default is to override */ - NULL, /* server config */ + "in parsed doc %s", |