jfclere     2004/08/04 08:53:21

  Modified:    ajp/proxy proxy_util.c
  Log:
  Arrange the handling of apr_array_header_t arrays.
  
  Revision  Changes    Path
  1.9       +12 -10    jakarta-tomcat-connectors/ajp/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/proxy_util.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- proxy_util.c      4 Aug 2004 15:13:35 -0000       1.8
  +++ proxy_util.c      4 Aug 2004 15:53:21 -0000       1.9
  @@ -992,7 +992,7 @@
                                                                proxy_server_conf 
*conf,
                                                                const char *url)
   {
  -    struct proxy_balancer *balancers;
  +    struct proxy_balancer *balancer;
       char *c, *uri = apr_pstrdup(p, url);
       int i;
       
  @@ -1002,10 +1002,11 @@
       /* remove path from uri */
       if ((c = strchr(c + 3, '/')))
           *c = '\0';
  -    balancers = (struct proxy_balancer *)conf->balancers;
  +    balancer = (struct proxy_balancer *)conf->balancers->elts;
       for (i = 0; i < conf->balancers->nelts; i++) {
  -        if (strcasecmp(balancers[i].name, uri) == 0)
  -            return &balancers[i];
  +        if (strcasecmp(balancer->name, uri) == 0)
  +            return balancer;
  +        balancer++;
       }
       return NULL;
   }
  @@ -1056,7 +1057,7 @@
                                                     proxy_server_conf *conf,
                                                     const char *url)
   {
  -    proxy_worker *workers;
  +    proxy_worker *worker;
       char *c, *uri = apr_pstrdup(p, url);
       int i;
       
  @@ -1066,10 +1067,11 @@
       /* remove path from uri */
       if ((c = strchr(c + 3, '/')))
           *c = '\0';
  -    workers = (proxy_worker *)conf->workers;
  +    worker = (proxy_worker *)conf->workers->elts;
       for (i = 0; i < conf->workers->nelts; i++) {
  -        if (strcasecmp(workers[i].name, uri) == 0)
  -            return &workers[i];
  +        if (strcasecmp(worker->name, uri) == 0)
  +            return worker;
  +        worker++;
       }
       return NULL;
   }
  @@ -1115,7 +1117,7 @@
       char *c, *q, *uri = apr_pstrdup(p, url);
       int port;
       
  -    c = strchr(url, ':');   
  +    c = strchr(uri, ':');   
       if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0')
          return "Bad syntax for a remote proxy server";
       /* remove path from uri */
  @@ -1133,7 +1135,7 @@
           port = -1;
       ap_str_tolower(uri);
       *worker = apr_array_push(conf->workers);
  -    (*worker)->name = apr_pstrdup(p, uri);
  +    (*worker)->name = apr_pstrdup(p, url);
       *c = '\0';
       (*worker)->scheme = uri;
       if (port == -1)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to