httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1065749 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.c mod_proxy.h
Date Mon, 31 Jan 2011 20:28:57 GMT
Author: jim
Date: Mon Jan 31 20:28:57 2011
New Revision: 1065749

URL: http://svn.apache.org/viewvc?rev=1065749&view=rev
Log:
tuck away code that lets us ensure that the id is always
"unique"

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1065749&r1=1065748&r2=1065749&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Mon Jan 31 20:28:57 2011
@@ -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_po
     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;

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1065749&r1=1065748&r2=1065749&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Jan 31 20:28:57 2011
@@ -808,8 +808,7 @@ ap_proxy_buckets_lifetime_transform(requ
 
 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"
 



Mime
View raw message