You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2004/09/09 12:26:30 UTC

cvs commit: httpd-2.0/modules/proxy proxy_util.c

mturk       2004/09/09 03:26:30

  Modified:    modules/proxy proxy_util.c
  Log:
  Use forward worker for all PROXYREQ_PROXY requests.
  
  Revision  Changes    Path
  1.137     +24 -7     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.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- proxy_util.c	18 Aug 2004 13:34:17 -0000	1.136
  +++ proxy_util.c	9 Sep 2004 10:26:29 -0000	1.137
  @@ -1236,7 +1236,17 @@
                                           proxy_server_conf *conf, char **url)
   {
       int access_status;
  -
  +    
  +    if (r->proxyreq == PROXYREQ_PROXY) {
  +        if (conf->forward) {
  +            *balancer = NULL;
  +            *worker = conf->forward;
  +            access_status = OK;
  +        }
  +        else
  +            access_status = DECLINED;
  +        return access_status;
  +    }
       access_status = proxy_run_pre_request(worker, balancer, r, conf, url);
       if (access_status == DECLINED && *balancer == NULL) {
           *worker = ap_proxy_get_worker(r->pool, conf, *url);
  @@ -1647,12 +1657,19 @@
                              uri->fragment ? "#" : "",
                              uri->fragment ? uri->fragment : "", NULL);
       }
  -    /* Worker can have the single constant backend adress.
  -     * The single DNS lookup is used once per worker.
  -     * If dynamic change is needed then set the addr to NULL
  -     * inside dynamic config to force the lookup.
  -     */
  -    if (!worker->cp->addr)
  +
  +    if (r->proxyreq == PROXYREQ_PROXY) {
  +        err = apr_sockaddr_info_get(&(worker->cp->addr),
  +                                    conn->hostname, APR_UNSPEC,
  +                                    conn->port, 0,
  +                                    p);
  +    }
  +    else if (!worker->cp->addr)
  +        /* Worker can have the single constant backend adress.
  +         * The single DNS lookup is used once per worker.
  +        * If dynamic change is needed then set the addr to NULL
  +        * inside dynamic config to force the lookup.
  +        */
           err = apr_sockaddr_info_get(&(worker->cp->addr),
                                       conn->hostname, APR_UNSPEC,
                                       conn->port, 0,