]> granicus.if.org Git - apache/commitdiff
tuck away code that lets us ensure that the id is always
authorJim Jagielski <jim@apache.org>
Mon, 31 Jan 2011 20:28:57 +0000 (20:28 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 31 Jan 2011 20:28:57 +0000 (20:28 +0000)
"unique"

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1065749 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h

index 97e0ccc6b3f9411cbe8d7aa002199d00c16b55f6..1014f3c0e1dc05149f64971f0a643fd607963071 100644 (file)
@@ -1141,6 +1141,7 @@ cleanup:
 
 static void * create_proxy_config(apr_pool_t *p, server_rec *s)
 {
+    unsigned int id;
     proxy_server_conf *ps = apr_pcalloc(p, sizeof(proxy_server_conf));
 
     ps->sec_proxy = apr_array_make(p, 10, sizeof(ap_conf_vector_t *));
@@ -1153,7 +1154,12 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s)
     ps->forward = NULL;
     ps->reverse = NULL;
     ps->domain = NULL;
-    ps->id = apr_psprintf(p, "%pp", ps->noproxies);
+#if 0
+    id = ap_proxy_hashfunc(apr_psprintf(p, "%pp-%" APR_TIME_T_FMT, ps->noproxies, apr_time_now()), PROXY_HASHFUNC_DEFAULT);
+#else
+    id = ap_proxy_hashfunc(apr_psprintf(p, "%pp", ps->noproxies), PROXY_HASHFUNC_DEFAULT);
+#endif
+    ps->id = apr_psprintf(p, "cnf_%x", id);
     ps->viaopt = via_off; /* initially backward compatible with 1.3.1 */
     ps->viaopt_set = 0; /* 0 means default */
     ps->req = 0;
index 558a441ece9aaa881521b351bcffc40a229e197c..1bd69a4748721b5c7c863be865f4ef541d0bf02b 100644 (file)
@@ -808,8 +808,7 @@ ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from,
 
 typedef enum { PROXY_HASHFUNC_DEFAULT, PROXY_HASHFUNC_APR,  PROXY_HASHFUNC_FNV } proxy_hash_t;
 
-PROXY_DECLARE(unsigned int)
-ap_proxy_hashfunc(const char *str, proxy_hash_t method);
+PROXY_DECLARE(unsigned int) ap_proxy_hashfunc(const char *str, proxy_hash_t method);
 
 #define PROXY_LBMETHOD "proxylbmethod"