On Wed, 19 Jun 2002, James Bromberger wrote:

> Seems that the current 2.8.8 has some problems patching into some of
> the mod_proxy code:
>
> ./ap/Makefile.tmpl.rej
> ./modules/proxy/mod_proxy.c.rej
> ./modules/proxy/proxy_http.c.rej

hmmmm... wonder why I didn't notice those before?  Sigh.  Anyway,
attached is a patch (totally untested!) which *should* replace the
missing part of the mod_ssl patch.  So after you've run ./configure
--force, apply this patch by going to the apache_1.3.26/ directory and
running "patch -p0 < modssl-2.8.8-1.3.26-fixup.patch".  Let me know if it
works or breaks.  ;)

--Cliff
--- ./src/ap/Makefile.tmpl-1.3.26       Tue Jun 18 20:32:48 2002
+++ ./src/ap/Makefile.tmpl      Tue Jun 18 20:33:18 2002
@@ -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) $<
--- ./src/modules/proxy/mod_proxy.c-1.3.26      Tue Jun 18 20:34:15 2002
+++ ./src/modules/proxy/mod_proxy.c     Tue Jun 18 20:36:36 2002
@@ -454,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);
     }
@@ -1051,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
 };
--- ./src/modules/proxy/proxy_http.c-1.3.26     Tue Jun 18 20:37:07 2002
+++ ./src/modules/proxy/proxy_http.c    Tue Jun 18 20:40:36 2002
@@ -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 =
@@ -320,14 +323,43 @@
     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
 
     if (conf->viaopt == via_block) {
         /* Block all outgoing Via: headers */

Reply via email to