Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 15038 invoked from network); 11 Sep 2004 09:31:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Sep 2004 09:31:14 -0000 Received: (qmail 70315 invoked by uid 500); 11 Sep 2004 09:31:12 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 70290 invoked by uid 500); 11 Sep 2004 09:31:12 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 70277 invoked by uid 500); 11 Sep 2004 09:31:12 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 70272 invoked by uid 99); 11 Sep 2004 09:31:12 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 11 Sep 2004 02:31:11 -0700 Received: (qmail 14996 invoked by uid 1526); 11 Sep 2004 09:31:10 -0000 Date: 11 Sep 2004 09:31:10 -0000 Message-ID: <20040911093110.14995.qmail@minotaur.apache.org> From: mturk@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/proxy mod_proxy.c proxy_util.c mod_proxy.h X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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