httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy mod_proxy.c proxy_util.c mod_proxy.h
Date Sat, 11 Sep 2004 09:31:10 GMT
mturk       2004/09/11 02:31:10

  Modified:    modules/proxy mod_proxy.c proxy_util.c mod_proxy.h
  Log:
  Do not add forward proxy to other proxies. Use new function to
  create the worker that isn't by default added to the list of other workers.
  This enalbles mixing forward and reverse proxy functionality on the same box.
  
  Revision  Changes    Path
  1.142     +7 -9      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.141
  retrieving revision 1.142
  diff -u -r1.141 -r1.142
  --- mod_proxy.c	10 Sep 2004 18:47:55 -0000	1.141
  +++ mod_proxy.c	11 Sep 2004 09:31:10 -0000	1.142
  @@ -1114,19 +1114,17 @@
   static const char *
       set_proxy_req(cmd_parms *parms, void *dummy, int flag)
   {
  -    const char *err;
       proxy_server_conf *psf =
       ap_get_module_config(parms->server->module_config, &proxy_module);
   
       psf->req = flag;
       psf->req_set = 1;
   
  -    if (flag) {
  -        /* Add default forward proxy worker */
  -        if ((err = ap_proxy_add_worker(&(psf->forward), parms->pool,
  -                                       psf, "*://*:0"))) {
  -            return apr_pstrcat(parms->temp_pool, "ProxyRequests ", err, NULL); 
  -        }
  +    if (flag && !psf->forward) {
  +        psf->forward = ap_proxy_create_worker(parms->pool);
  +        psf->forward->name     = "proxy:forward";
  +        psf->forward->hostname = "*";
  +        psf->forward->scheme   = "*";
   
           /* Do not disable worker in case of errors */
           psf->forward->status = PROXY_WORKER_IGNORE_ERRORS;
  @@ -1610,8 +1608,8 @@
           ap_proxy_initialize_worker(worker, s);
           worker++;
       }
  -
  -    ap_proxy_initialize_worker(conf->forward, s);
  +    if (conf->forward)
  +        ap_proxy_initialize_worker(conf->forward, s);
   
       return OK;
   }
  
  
  
  1.149     +10 -0     httpd-2.0/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- proxy_util.c	11 Sep 2004 09:12:26 -0000	1.148
  +++ proxy_util.c	11 Sep 2004 09:31:10 -0000	1.149
  @@ -1149,6 +1149,16 @@
       return NULL;
   }
   
  +PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p)
  +{
  +
  +    proxy_worker *worker;
  +    worker = (proxy_worker *)apr_pcalloc(p, sizeof(proxy_worker));
  +    init_conn_pool(p, worker);
  +
  +    return worker;
  +}
  +
   PROXY_DECLARE(void) 
   ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer, proxy_worker
*worker)
   {
  
  
  
  1.132     +7 -0      httpd-2.0/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.h,v
  retrieving revision 1.131
  retrieving revision 1.132
  diff -u -r1.131 -r1.132
  --- mod_proxy.h	11 Sep 2004 09:12:26 -0000	1.131
  +++ mod_proxy.h	11 Sep 2004 09:31:10 -0000	1.132
  @@ -410,6 +410,13 @@
                                                   const char *url);
   
   /**
  + * Create new worker
  + * @param p      memory pool to allocate worker from 
  + * @return       new worker
  + */
  +PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p);
  +
  +/**
    * Initize the worker
    * @param worker the new worker
    * @param p      memory pool to allocate worker from 
  
  
  

Mime
View raw message