From 53bf5b2c19a59611f9d9137f037e763a7f82f790 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 18 Sep 2012 18:02:31 +0000 Subject: [PATCH] By using a consistent naming structure, we can persist across stop/starts (assuming people don't change such basics as scheme, hostname, etc...) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1387287 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 04f1a21cd8..8c0cd78412 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1142,12 +1142,16 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s) ps->forward = NULL; ps->reverse = NULL; ps->domain = NULL; -#if 0 - id = ap_proxy_hashfunc(apr_psprintf(p, "%pp-%" APR_TIME_T_FMT, ps, apr_time_now()), PROXY_HASHFUNC_DEFAULT); -#else - id = ap_proxy_hashfunc(apr_psprintf(p, "%pp", s), PROXY_HASHFUNC_DEFAULT); -#endif - ps->id = apr_psprintf(p, "s%x", id); + /* yeah, ugly, but we need this both unique but consistent */ + id = ap_proxy_hashfunc(apr_psprintf(p, "%s.%s.%d.%s.%s.%s", + (s->server_scheme ? s->server_scheme : "????"), + (s->server_hostname ? s->server_hostname : "???"), + (int)s->port, + (s->server_admin ? s->server_admin : "??"), + (s->defn_name ? s->defn_name : "?"), + (s->error_fname ? s->error_fname : DEFAULT_ERRORLOG)) + , PROXY_HASHFUNC_DEFAULT); + ps->id = apr_psprintf(p, "p%x", id); ps->viaopt = via_off; /* initially backward compatible with 1.3.1 */ ps->viaopt_set = 0; /* 0 means default */ ps->req = 0; -- 2.40.0