httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy mod_proxy.c
Date Wed, 11 Aug 2004 23:00:07 GMT
wrowe       2004/08/11 16:00:07

  Modified:    modules/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.
  
  Submitted by: mturk
  
  Revision  Changes    Path
  1.125     +18 -7     httpd-2.0/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.c,v
  retrieving revision 1.124
  retrieving revision 1.125
  diff -u -r1.124 -r1.125
  --- mod_proxy.c	11 Aug 2004 22:48:13 -0000	1.124
  +++ mod_proxy.c	11 Aug 2004 23:00:07 -0000	1.125
  @@ -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);
       }
  
  
  

Mime
View raw message