Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 81214 invoked from network); 6 Jan 2006 21:12:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jan 2006 21:12:24 -0000 Received: (qmail 19397 invoked by uid 500); 6 Jan 2006 21:12:24 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 19214 invoked by uid 500); 6 Jan 2006 21:12:23 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 19203 invoked by uid 99); 6 Jan 2006 21:12:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 13:12:23 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of torsten.foertsch@gmx.net designates 213.165.64.21 as permitted sender) Received: from [213.165.64.21] (HELO mail.gmx.net) (213.165.64.21) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 06 Jan 2006 13:12:22 -0800 Received: (qmail invoked by alias); 06 Jan 2006 21:12:00 -0000 Received: from p54AD213A.dip0.t-ipconnect.de (EHLO opi.home) [84.173.33.58] by mail.gmx.net (mp032) with SMTP; 06 Jan 2006 22:12:00 +0100 X-Authenticated: #1700068 Received: by opi.home (Postfix, from userid 1000) id 704B2891C8; Fri, 6 Jan 2006 22:11:59 +0100 (CET) From: Torsten Foertsch To: dev@perl.apache.org Subject: [PATCH] Apache2::RequestUtil->add_config Date: Fri, 6 Jan 2006 22:09:14 +0100 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1633978.gQvPczSWm8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200601062209.18830.torsten.foertsch@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --nextPart1633978.gQvPczSWm8 Content-Type: multipart/mixed; boundary="Boundary-01=_6xtvDoog0IS2oiS" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_6xtvDoog0IS2oiS Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, the patch below solves the following situation. The ProxyPassReverse directive is outside any block given as ProxyPassReverse /path http://... but inside a Location block without the /path specification: ProxyPassReverse http://... In the latter case the path is taken from $parms->path, that means the path= of=20 the Location block. Since $r->add_config([@lines]) is literally a @lines ProxyPassReverse cannot be applied with $r->add_config for a path other tha= n=20 "/". The patch adds an optional 3rd parameter to $r->add_config that lets you pa= ss=20 in the path. I don't think ProxyPassReverse is the only directive that behaves this way. Torsten --Boundary-01=_6xtvDoog0IS2oiS Content-Type: text/x-diff; charset="us-ascii"; name="modperl_add_config.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="modperl_add_config.patch" diff -Naur -x '*~' mod_perl-2.0.2/docs/api/Apache2/RequestUtil.pod mod_perl= =2D2.0.2.new/docs/api/Apache2/RequestUtil.pod =2D-- mod_perl-2.0.2/docs/api/Apache2/RequestUtil.pod 2005-10-21 02:05:00.0= 00000000 +0200 +++ mod_perl-2.0.2.new/docs/api/Apache2/RequestUtil.pod 2006-01-06 21:28:52= =2E257619564 +0100 @@ -108,6 +108,10 @@ =20 $r->add_config($lines); $r->add_config($lines, $override); + $r->add_config($lines, $override, $path); + +Configuration directives are processed as if given in a CLocationE> +block. =20 =3Dover 4 =20 @@ -127,6 +131,14 @@ Default value is: C> =20 +=3Ditem opt arg3: C<$path> ( string ) + +Set the C> C= component. +This is the path of the CLocationE> block. Some directives need = this, +for example C. + +Default value is: C + =3Ditem ret: no return value =20 =3Ditem since: 2.0.00 diff -Naur -x '*~' mod_perl-2.0.2/src/modules/perl/modperl_config.c mod_per= l-2.0.2.new/src/modules/perl/modperl_config.c =2D-- mod_perl-2.0.2/src/modules/perl/modperl_config.c 2005-10-21 02:04:26.= 000000000 +0200 +++ mod_perl-2.0.2.new/src/modules/perl/modperl_config.c 2006-01-06 20:20:4= 8.928955761 +0100 @@ -578,16 +578,17 @@ const char *modperl_config_insert_request(pTHX_ request_rec *r, SV *lines, =2D int override) + int override, + char *path) { const char *errmsg; ap_conf_vector_t *dconf =3D ap_create_per_dir_config(r->pool); =20 =2D /* The path argument of "/" is only required to be non-NULL =2D and "/" is as good a default as anything else */ + /* The path argument required to be non-NULL + and "/" is as good a default if nothing else given */ errmsg =3D modperl_config_insert(aTHX_ r->server, r->pool, r->pool, =2D override, "/", + override, path ? apr_pstrdup( r->pool, = path ) : "/", dconf, lines); =20 if (errmsg) { diff -Naur -x '*~' mod_perl-2.0.2/src/modules/perl/modperl_config.h mod_per= l-2.0.2.new/src/modules/perl/modperl_config.h =2D-- mod_perl-2.0.2/src/modules/perl/modperl_config.h 2005-10-21 02:04:26.= 000000000 +0200 +++ mod_perl-2.0.2.new/src/modules/perl/modperl_config.h 2006-01-06 14:41:5= 9.751611738 +0100 @@ -142,7 +142,8 @@ const char *modperl_config_insert_request(pTHX_ request_rec *r, SV *lines, =2D int override); + int override, + char *path); =20 int modperl_config_is_perl_option_enabled(pTHX_ request_rec *r, server_rec *s, const char *name); diff -Naur -x '*~' mod_perl-2.0.2/xs/Apache2/Access/Apache2__Access.h mod_p= erl-2.0.2.new/xs/Apache2/Access/Apache2__Access.h =2D-- mod_perl-2.0.2/xs/Apache2/Access/Apache2__Access.h 2005-10-21 02:04:2= 9.000000000 +0200 +++ mod_perl-2.0.2.new/xs/Apache2/Access/Apache2__Access.h 2006-01-06 14:42= :39.364339029 +0100 @@ -80,7 +80,8 @@ errmsg =3D modperl_config_insert_request(aTHX_ r, newRV_noinc((SV*)config), =2D OR_AUTHCFG); + OR_AUTHCFG, + NULL); =20 if (errmsg) { Perl_warn(aTHX_ "Can't change %s to '%s'\n", directive, val); diff -Naur -x '*~' mod_perl-2.0.2/xs/Apache2/RequestUtil/Apache2__RequestUt= il.h mod_perl-2.0.2.new/xs/Apache2/RequestUtil/Apache2__RequestUtil.h =2D-- mod_perl-2.0.2/xs/Apache2/RequestUtil/Apache2__RequestUtil.h 2005-10-= 21 02:04:29.000000000 +0200 +++ mod_perl-2.0.2.new/xs/Apache2/RequestUtil/Apache2__RequestUtil.h 2006-0= 1-06 14:41:00.093552200 +0100 @@ -302,10 +302,10 @@ } =20 static MP_INLINE =2Dvoid mpxs_Apache2__RequestRec_add_config(pTHX_ request_rec *r, SV *lines= , int override) +void mpxs_Apache2__RequestRec_add_config(pTHX_ request_rec *r, SV *lines, = int override, char *path) { const char *errmsg =3D modperl_config_insert_request(aTHX_ r, lines, =2D override); + override, path); if (errmsg) { Perl_croak(aTHX_ "$r->add_config() has failed: %s", errmsg); } diff -Naur -x '*~' mod_perl-2.0.2/xs/maps/modperl_functions.map mod_perl-2.= 0.2.new/xs/maps/modperl_functions.map =2D-- mod_perl-2.0.2/xs/maps/modperl_functions.map 2005-10-21 02:04:27.0000= 00000 +0200 +++ mod_perl-2.0.2.new/xs/maps/modperl_functions.map 2006-01-06 14:49:57.60= 1992838 +0100 @@ -30,7 +30,7 @@ mpxs_Apache2__RequestRec_location mpxs_Apache2__RequestRec_as_string mpxs_Apache2__RequestRec_pnotes | | r, key=3DNullsv, val=3DNullsv =2D mpxs_Apache2__RequestRec_add_config | | r, lines, override=3DOR_AUTHCFG= =20 + mpxs_Apache2__RequestRec_add_config | | r, lines, override=3DOR_AUTHCFG, = path=3DNULL=20 mpxs_Apache2__RequestRec_document_root | | r, new_root=3DNullsv mpxs_Apache2__RequestRec_child_terminate =20 diff -Naur -x '*~' mod_perl-2.0.2/xs/tables/current/ModPerl/FunctionTable.p= m mod_perl-2.0.2.new/xs/tables/current/ModPerl/FunctionTable.pm =2D-- mod_perl-2.0.2/xs/tables/current/ModPerl/FunctionTable.pm 2005-10-21 = 02:04:29.000000000 +0200 +++ mod_perl-2.0.2.new/xs/tables/current/ModPerl/FunctionTable.pm 2006-01-0= 6 14:52:42.194073075 +0100 @@ -1417,6 +1417,10 @@ { 'type' =3D> 'int', 'name' =3D> 'override' + }, + { + 'type' =3D> 'char *', + 'name' =3D> 'path' } ] }, @@ -6636,6 +6640,10 @@ { 'type' =3D> 'int', 'name' =3D> 'override' + }, + { + 'type' =3D> 'char *', + 'name' =3D> 'path' } ] }, --Boundary-01=_6xtvDoog0IS2oiS-- --nextPart1633978.gQvPczSWm8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBDvtx+wicyCTir8T4RAlWEAJsEmdcHyGW+3s6shUDrRSZiFtKStgCgsIyO 6g/l3UnjubH5Hs4Qt/unDEI= =6zf2 -----END PGP SIGNATURE----- --nextPart1633978.gQvPczSWm8--