summaryrefslogtreecommitdiff
path: root/www/apache/patches
diff options
context:
space:
mode:
authortv <tv@pkgsrc.org>1998-12-03 22:26:52 +0000
committertv <tv@pkgsrc.org>1998-12-03 22:26:52 +0000
commit9eb89f8fafd317c9ab7354004134b2db882fc02e (patch)
tree33f6a231c8fb63856f9e20ceaecf9e4f0e898f0e /www/apache/patches
parent119d60c7a10a618316da101215df55a026c76c54 (diff)
downloadpkgsrc-9eb89f8fafd317c9ab7354004134b2db882fc02e.tar.gz
Bump version to "1.3.3.1": Add parse_string to the include_extern
interface, and use the EAPI hooks interface for calling external mod_include subs. (Needed to make mod_perl work as a DSO.)
Diffstat (limited to 'www/apache/patches')
-rw-r--r--www/apache/patches/patch-af98
1 files changed, 29 insertions, 69 deletions
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",