summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2011-02-08 14:59:36 +0100
committerJim Jagielski <jim@apache.org>2011-02-08 14:59:36 +0100
commitf863547c32988c9b5ad8065680cdc69935c17b62 (patch)
treefb7acd235aa63b54b4c479c38e64940fde1e8913 /modules
parent* server/mpm/prefork/prefork.c (stop_listening, sig_term, restart): (diff)
downloadapache2-f863547c32988c9b5ad8065680cdc69935c17b62.tar.xz
apache2-f863547c32988c9b5ad8065680cdc69935c17b62.zip
Expose this as part of the API. That way, other code/modules
which want to overload mod_proxy's trans phase can use it to handle ProxyPass as well, without requiring monkeying with conf->aliases... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1068400 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/proxy/mod_proxy.c10
-rw-r--r--modules/proxy/mod_proxy.h11
2 files changed, 16 insertions, 5 deletions
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
index cefc3d0ead..76bb195e2b 100644
--- a/modules/proxy/mod_proxy.c
+++ b/modules/proxy/mod_proxy.c
@@ -539,8 +539,8 @@ static apr_array_header_t *proxy_vars(request_rec *r,
return ret;
}
-static int proxy_trans_match(request_rec *r, struct proxy_alias *ent,
- proxy_dir_conf *dconf)
+PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
+ proxy_dir_conf *dconf)
{
int len;
const char *fake;
@@ -552,7 +552,7 @@ static int proxy_trans_match(request_rec *r, struct proxy_alias *ent,
unsigned int nocanon = ent->flags & PROXYPASS_NOCANON;
const char *use_uri = nocanon ? r->unparsed_uri : r->uri;
- if ((dconf->interpolate_env == 1) && (ent->flags & PROXYPASS_INTERPOLATE)) {
+ if (dconf && (dconf->interpolate_env == 1) && (ent->flags & PROXYPASS_INTERPOLATE)) {
fake = proxy_interpolate(r, ent->fake);
real = proxy_interpolate(r, ent->real);
}
@@ -653,7 +653,7 @@ static int proxy_trans(request_rec *r)
/* short way - this location is reverse proxied? */
if (dconf->alias) {
- int rv = proxy_trans_match(r, dconf->alias, dconf);
+ int rv = ap_proxy_trans_match(r, dconf->alias, dconf);
if (DONE != rv) {
return rv;
}
@@ -666,7 +666,7 @@ static int proxy_trans(request_rec *r)
if (conf->aliases->nelts) {
ent = (struct proxy_alias *) conf->aliases->elts;
for (i = 0; i < conf->aliases->nelts; i++) {
- int rv = proxy_trans_match(r, &ent[i], dconf);
+ int rv = ap_proxy_trans_match(r, &ent[i], dconf);
if (DONE != rv) {
return rv;
}
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
index 5615fbbabf..c106c43952 100644
--- a/modules/proxy/mod_proxy.h
+++ b/modules/proxy/mod_proxy.h
@@ -863,6 +863,17 @@ PROXY_DECLARE(char *) ap_proxy_parse_wstatus(apr_pool_t *p, proxy_worker *w);
PROXY_DECLARE(apr_status_t) ap_proxy_update_members(proxy_balancer *b, server_rec *s,
proxy_server_conf *conf);
+
+/**
+ * Find the matched alias for this request and setup for proxy handler
+ * @param r request
+ * @param ent proxy_alias record
+ * @param dconf per-dir config or NULL
+ * @return DECLINED, DONE or OK if matched
+ */
+PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
+ proxy_dir_conf *dconf);
+
#define PROXY_LBMETHOD "proxylbmethod"
/* The number of dynamic workers that can be added when reconfiguring.