tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c
Date Mon, 09 Aug 2004 15:10:02 GMT
mturk       2004/08/09 08:10:02

  Modified:    ajp/proxy mod_proxy.c
  Log:
  Add pool to functions for setting worker and balancer parameters.
  Still have no idea why that doesn't work without duping as JeanFrederic reported.
  
  Revision  Changes    Path
  1.31      +18 -7     jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- mod_proxy.c	9 Aug 2004 08:04:55 -0000	1.30
  +++ mod_proxy.c	9 Aug 2004 15:10:02 -0000	1.31
  @@ -82,7 +82,8 @@
           (w)->io_buffer_size_set   = (c)->io_buffer_size_set;    \
       } while (0)
   
  -static const char *set_worker_param(proxy_worker *worker,
  +static const char *set_worker_param(apr_pool_t *p,
  +                                    proxy_worker *worker,
                                       const char *key,
                                       const char *val)
   {
  @@ -160,20 +161,27 @@
               return "KeepAlive must be On|Off";
           worker->keepalive_set = 1;
       }    
  +    else if (!strcasecmp(key, "route")) {
  +        worker->route = apr_pstrdup(p, val);
  +    }
  +    else if (!strcasecmp(key, "redirect")) {
  +        worker->redirect = apr_pstrdup(p, val);
  +    }
       else {
           return "unknown parameter";
       }
       return NULL;
   }
   
  -static const char *set_balancer_param(proxy_balancer *balancer,
  +static const char *set_balancer_param(apr_pool_t *p,
  +                                      proxy_balancer *balancer,
                                         const char *key,
                                         const char *val)
   {
   
       int ival;
       if (!strcasecmp(key, "stickysession")) {
  -        balancer->sticky = val;
  +        balancer->sticky = apr_pstrdup(p, val);
       }
       else if (!strcasecmp(key, "nofailover")) {
           if (!strcasecmp(val, "on"))
  @@ -186,7 +194,7 @@
       else if (!strcasecmp(key, "timeout")) {
           ival = atoi(val);
           if (ival < 1)
  -            return "timeout must be al least one second";
  +            return "timeout must be at least one second";
           balancer->timeout = apr_time_from_sec(ival);
       }
       else {
  @@ -886,7 +894,8 @@
                   return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL);
           }        
           for (i = 0; i < arr->nelts; i++) {
  -            const char *err = set_balancer_param(balancer, elts[i].key, elts[i].val);
  +            const char *err = set_balancer_param(cmd->pool, balancer, elts[i].key,
  +                                                 elts[i].val);
               if (err)
                   return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL);
           }
  @@ -901,7 +910,8 @@
           PROXY_COPY_CONF_PARAMS(worker, conf);
   
           for (i = 0; i < arr->nelts; i++) {
  -            const char *err = set_worker_param(worker, elts[i].key, elts[i].val);
  +            const char *err = set_worker_param(cmd->pool, worker, elts[i].key,
  +                                               elts[i].val);
               if (err)
                   return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL);
           }
  @@ -1275,7 +1285,8 @@
       arr = apr_table_elts(params);
       elts = (const apr_table_entry_t *)arr->elts;
       for (i = 0; i < arr->nelts; i++) {
  -        const char *err = set_worker_param(worker, elts[i].key, elts[i].val);
  +        const char *err = set_worker_param(cmd->pool, worker, elts[i].key,
  +                                           elts[i].val);
           if (err)
               return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL);
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message