Return-Path: Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: (qmail 66970 invoked from network); 16 Jul 2008 18:14:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jul 2008 18:14:09 -0000 Received: (qmail 90631 invoked by uid 500); 16 Jul 2008 18:14:08 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 90605 invoked by uid 500); 16 Jul 2008 18:14:08 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: "Apache HTTPD Bugs Notification List" List-Id: Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 90591 invoked by uid 99); 16 Jul 2008 18:14:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2008 11:14:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2008 18:13:21 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 3ACDD234C173; Wed, 16 Jul 2008 11:12:39 -0700 (PDT) From: bugzilla@apache.org To: bugs@httpd.apache.org Subject: DO NOT REPLY [Bug 45405] Allow binding port to be set for individual workers for proxy requests X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Apache httpd-2 X-Bugzilla-Component: mod_proxy X-Bugzilla-Keywords: PatchAvailable X-Bugzilla-Severity: enhancement X-Bugzilla-Who: apache+bugreports@kd6lvw.ampr.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: bugs@httpd.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC In-Reply-To: Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Message-Id: <20080716181240.3ACDD234C173@brutus.apache.org> Date: Wed, 16 Jul 2008 11:12:39 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=45405 D. Stussy changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |apache+bugreports@kd6lvw.amp | |r.org --- Comment #1 from D. Stussy 2008-07-16 11:12:38 PST --- Comments: 1) In this version, you're still defining variables inside the for(;;) statement. As noted in the parent enhancement 44806, that is not a portable construction for some compilers. Please pull the declarations out of the for() statements. Otherwise, except for a small change in which structure the data is stored in, the code looks almost identical to our prior solution, so it should work without additional extensive testing. 2) My thought was to have BOTH a virtual-host-wide "ProxyBindAddress" and an individual setting for a proxy worker if separately defined. Therefore, when a worker is first initialized, shouldn't it copy the bind-address info from the "conf" structure to the "worker" structure (which maybe subsequently overwritten by a worker-specific directive)? Simply copying the data from one structure to the other should suffice, INCLUDING copying the pointer - as "conf" should never be released as long as it has a "worker" structure under it. I make one assumption: That at least one "worker" structure will always exist for each "conf" structure (I have not confirmed that in the code). As such: changes to proxy_util.c would be as per this patch, not 44806. changes to mod_proxy.c from both would be combined into a parsing routine that passes the character string and addresses for 3 parameters. The fourth parameter, "...->bindopt_set" could be determined from the return code of the parsing subroutine (char *; NULL == success, otherwise error message). There would be minimal code changes to both line ranges for the TWO calls to the parser, one for "ProxyBindAddress" and one for "ProxySet ... bind=". + Also, a "new_worker()" routine needs to copy data from "conf" to "worker". changes to mod_proxy.h would have BOTH changes, one from each enhancement. for mod_proxy.c: char *parse_bind_address(char *addr, apr_sockaddr_t **bind_addr, apr_port_t *bind_port, apr_port_t *bind_range) move the parsing code into here - adjusting as necessary. from main configuration - ProxyBindAddress() set_proxy_bindaddr(cmd_parms *parms, void *dummy, const char *addr) +{ + char *range, *host, *scope_id; + apr_port_t port; + int r = 0; + + proxy_server_conf *psf = + ap_get_module_config(parms->server->module_config, &proxy_module); + ++ char *rc; ++ rc = parse_bind_address( addr, &psf->bind_addr, &psf->bind_port, &psf->bind_range) ++ if (rc == NULL) { ++ psf->bind_idx = 0; ++ psf->bindopt_set = 1; ++ } + return rc; from worker configuration - ProxySet() ... bind= + else if (!strcasecmp(key, "bind")) { ++ char *rc; ++ rc = parse_bind_address( (char*)val, &worker->bind_addr, ++ &worker->bind_port, &worker->bind_range) ++ if (rc == NULL) { ++ worker->bind_idx = 0; ++ worker->bindopt_set = 1; ++ } ++ return rc; + } else { return "unknown Worker parameter"; Configuration notes: - Workers defined via ProxySet BEFORE ProxyBindAddress would inherit the default settings of no info (unspecified address, port 0, range 1). - Workers defined via ProxySet AFTER ProxyBindAddress should inherit the ProxyBindAddress settings in effect for its scope (main config, virtual host, etc). -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org