httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1207467 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h proxy_util.c
Date Mon, 28 Nov 2011 17:10:18 GMT
Author: jim
Date: Mon Nov 28 17:10:17 2011
New Revision: 1207467

URL: http://svn.apache.org/viewvc?rev=1207467&view=rev
Log:
"Final" (I hope) proxy struct/API changes in order to support
dynamic balancer allocation AND dynamic vhost-balancers

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

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1207467&r1=1207466&r2=1207467&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Nov 28 17:10:17 2011
@@ -298,6 +298,7 @@ PROXY_WORKER_DISABLED | PROXY_WORKER_STO
 /* Some max char string sizes, for shm fields */
 #define PROXY_WORKER_MAX_SCHEME_SIZE    16
 #define PROXY_WORKER_MAX_ROUTE_SIZE     64
+#define PROXY_BALANCER_MAX_ROUTE_SIZE PROXY_WORKER_MAX_ROUTE_SIZE
 #define PROXY_WORKER_MAX_NAME_SIZE      96
 #define PROXY_BALANCER_MAX_NAME_SIZE PROXY_WORKER_MAX_NAME_SIZE
 #define PROXY_WORKER_MAX_HOSTNAME_SIZE  64
@@ -401,7 +402,8 @@ typedef struct {
     char      nonce[APR_UUID_FORMATTED_LENGTH + 1];
     char      name[PROXY_BALANCER_MAX_NAME_SIZE];
     char      sname[PROXY_BALANCER_MAX_NAME_SIZE];
-    char      alias[PROXY_BALANCER_MAX_NAME_SIZE];
+    char      vpath[PROXY_BALANCER_MAX_ROUTE_SIZE];
+    char      vhost[PROXY_BALANCER_MAX_HOSTNAME_SIZE];
     apr_interval_time_t timeout;  /* Timeout for waiting on free connection */
     apr_time_t      wupdated;     /* timestamp of last change to workers list */
     int             max_attempts;     /* Number of attempts before failing */

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1207467&r1=1207466&r2=1207467&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Nov 28 17:10:17 2011
@@ -1329,6 +1329,7 @@ PROXY_DECLARE(char *) ap_proxy_define_ba
     proxy_balancer_shared *bshared;
     char *c, *q, *uri = apr_pstrdup(p, url);
     const char *sname;
+    apr_uri_t puri;
 
     /* We should never get here without a valid BALANCER_PREFIX... */
 
@@ -1343,6 +1344,8 @@ PROXY_DECLARE(char *) ap_proxy_define_ba
     *balancer = apr_array_push(conf->balancers);
     memset(*balancer, 0, sizeof(proxy_balancer));
 
+    apr_uri_parse(p, alias, &puri);
+
     /*
      * NOTE: The default method is byrequests, which we assume
      * exists!
@@ -1375,8 +1378,8 @@ PROXY_DECLARE(char *) ap_proxy_define_ba
     if (PROXY_STRNCPY(bshared->sname, sname) != APR_SUCCESS) {
         return apr_psprintf(p, "balancer safe-name (%s) too long", sname);
     }
-    if (PROXY_STRNCPY(bshared->alias, alias) != APR_SUCCESS) {
-        return apr_psprintf(p, "balancer front-end url (%s) too long", alias);
+    if (PROXY_STRNCPY(bshared->vpath, puri.path) != APR_SUCCESS) {
+        return apr_psprintf(p, "balancer front-end virtual-path (%s) too long", puri.path);
     }
     bshared->hash = ap_proxy_hashfunc(bshared->name, PROXY_HASHFUNC_DEFAULT);    
     (*balancer)->hash = bshared->hash;



Mime
View raw message