summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/src/modules/proxy
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2000-03-19 11:16:13 +0000
committerbeck <beck@openbsd.org>2000-03-19 11:16:13 +0000
commit7162a7a1f02eb4e2e0065733ca2d04d7558e49e4 (patch)
tree97e4405d808cb4f9cd304e4ef041b1b542fdb0d8 /usr.sbin/httpd/src/modules/proxy
parentnew minty 0.9.5 openssl (diff)
downloadwireguard-openbsd-7162a7a1f02eb4e2e0065733ca2d04d7558e49e4.tar.xz
wireguard-openbsd-7162a7a1f02eb4e2e0065733ca2d04d7558e49e4.zip
apache 1.3.12 + mod_ssl 2.6.2 merge
Diffstat (limited to 'usr.sbin/httpd/src/modules/proxy')
-rw-r--r--usr.sbin/httpd/src/modules/proxy/mod_proxy.c4
-rw-r--r--usr.sbin/httpd/src/modules/proxy/proxy_http.c13
-rw-r--r--usr.sbin/httpd/src/modules/proxy/proxy_util.c14
3 files changed, 24 insertions, 7 deletions
diff --git a/usr.sbin/httpd/src/modules/proxy/mod_proxy.c b/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
index 0587ec319f6..ea2b0da71bd 100644
--- a/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
+++ b/usr.sbin/httpd/src/modules/proxy/mod_proxy.c
@@ -247,6 +247,10 @@ static int proxy_fixup(request_rec *r)
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
diff --git a/usr.sbin/httpd/src/modules/proxy/proxy_http.c b/usr.sbin/httpd/src/modules/proxy/proxy_http.c
index 78a889a6b26..b08dca9b518 100644
--- a/usr.sbin/httpd/src/modules/proxy/proxy_http.c
+++ b/usr.sbin/httpd/src/modules/proxy/proxy_http.c
@@ -189,6 +189,9 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
const char *urlptr = NULL;
const char *datestr;
struct tbl_do_args tdo;
+#ifdef EAPI
+ char *peer;
+#endif
void *sconf = r->server->module_config;
proxy_server_conf *conf =
@@ -249,12 +252,18 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
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(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
}
sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -315,9 +324,9 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
{
char *errmsg = NULL;
ap_hook_use("ap::mod_proxy::http::handler::new_connection",
- AP_HOOK_SIG3(ptr,ptr,ptr),
+ AP_HOOK_SIG4(ptr,ptr,ptr,ptr),
AP_HOOK_DECLINE(NULL),
- &errmsg, r, f);
+ &errmsg, r, f, peer);
if (errmsg != NULL)
return ap_proxyerror(r, HTTP_BAD_GATEWAY, errmsg);
}
diff --git a/usr.sbin/httpd/src/modules/proxy/proxy_util.c b/usr.sbin/httpd/src/modules/proxy/proxy_util.c
index 52f8f50aaee..d1d47208070 100644
--- a/usr.sbin/httpd/src/modules/proxy/proxy_util.c
+++ b/usr.sbin/httpd/src/modules/proxy/proxy_util.c
@@ -844,11 +844,15 @@ int ap_proxyerror(request_rec *r, int statuscode, const char *message)
ap_table_setn(r->notes, "error-notes",
ap_pstrcat(r->pool,
"The proxy server could not handle the request "
- "<EM><A HREF=\"", r->uri, "\">",
- r->method, "&nbsp;", r->uri, "</A></EM>.<P>\n"
- "Reason: <STRONG>", message, "</STRONG>", NULL));
-
- /* Allow the "error-notes" string to be printed by ap_send_error_response() */
+ "<EM><A HREF=\"", ap_escape_uri(r->pool, r->uri),
+ "\">", ap_escape_html(r->pool, r->method),
+ "&nbsp;",
+ ap_escape_html(r->pool, r->uri), "</A></EM>.<P>\n"
+ "Reason: <STRONG>",
+ ap_escape_html(r->pool, message),
+ "</STRONG>", NULL));
+
+ /* Allow "error-notes" string to be printed by ap_send_error_response() */
ap_table_setn(r->notes, "verbose-error-to", ap_pstrdup(r->pool, "*"));
r->status_line = ap_psprintf(r->pool, "%3.3u Proxy Error", statuscode);