Commit 75dc790b authored by Jim Jagielski's avatar Jim Jagielski
Browse files

tuck away code that lets us ensure that the id is always

"unique"

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1065749 13f79535-47bb-0310-9956-ffa450edef68
parent 4536459f
Loading
Loading
Loading
Loading
+7 −1
Changes for modules/proxy/mod_proxy.c: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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;
+1 −2
Changes for modules/proxy/mod_proxy.h: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -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"