This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig4852C329BAC5B40535CF058A
Content-Type: multipart/mixed;
boundary="------------060209070604020100030406"

This is a multi-part message in MIME format.
--------------060209070604020100030406
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Andreas J. Koenig wrote:
>>>>>> On Mon, 10 Jul 2006 12:20:30 -0700, "Philippe M. Chiasson"

ectoplasm.org> said:
>=20
> >> ok, thanks for trying
> >>=20
> >> I'm including gozer here, since he is the main PerlConfig guy - I
> >> wouldn't want to step on his toes trying to implement a fix for thi=

s
> >> issue. but it we harp on him he will probably have an answer in a
> >> matter of seconds

>=20
> > Slightly longer than a few seconds, but here is a patch that will p=

robably
> > fix this issue as well as the the one linked to.

>=20
> Very nice, thanks very, very much, it seems to work perfectly well.


Checked in as http://svn.apache.org/viewvc?view=3D...ision=3D422774

> One nit while we are at it: errors during execution of $PerlConfig
> would be much less pain if we could get real line numbers and file
> names. From the manpage I would believe that this is feasible now?


Yes, that's been annoying me for a long time as well...

> Look what I got (the error was well spotted and correct, but I still
> did not know where to search because I have many sections and
> many $PerlConfig variables):
>=20
> [Mon Jul 17 12:52:15 2006] [warn] The Alias directive in mod_perl at li=

ne 1 will probably never match because it overlaps an earlier Alias.

The attached patch should address this problem. Let me know if it works a=
nd
helps locating the source of that warning.

-------------------------------------------------------------------------=
-------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 8=
8C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 8=
8C3A5A5

--------------060209070604020100030406
Content-Type: text/x-patch;
name="perldo_file_line.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="perldo_file_line.patch"

Index: src/modules/perl/modperl_common_util.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- src/modules/perl/modperl_common_util.h (revision 422775)
+++ src/modules/perl/modperl_common_util.h (working copy)
@@ -77,6 +77,8 @@
#define MP_magical_tie(sv, mg_flags) \
SvFLAGS((SV*)sv) |=3D mg_flags
=20
+#define MP_PERLSECTIONS_DIRECTIVE_SV \
+ get_sv("Apache2::PerlSections:irective", TRUE)
=20
/* tie %hash */
MP_INLINE SV *modperl_hash_tie(pTHX_ const char *classname,
Index: src/modules/perl/modperl_config.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- src/modules/perl/modperl_config.c (revision 422775)
+++ src/modules/perl/modperl_config.c (working copy)
@@ -480,6 +480,7 @@
typedef struct {
AV *av;
I32 ix;
+ I32 skip;
PerlInterpreter *perl;
} svav_param_t;
=20
@@ -495,10 +496,17 @@
return NULL;
}
=20
- sv =3D AvARRAY(av)[svav_param->ix++];
- SvPV_force(sv, n_a);
-
- apr_cpystrn(buf, SvPVX(sv), bufsiz);
+ /* Skipping lines is the only way to control the apparent
+ * line number when errors/warnings are reported
+ */
+ if (svav_param->skip-- > 0) {
+ apr_cpystrn(buf, "", bufsiz);
+ }
+ else {
+ sv =3D AvARRAY(av)[svav_param->ix++];
+ SvPV_force(sv, n_a);
+ apr_cpystrn(buf, SvPVX(sv), bufsiz);
+ }
=20
return buf;
}
@@ -516,6 +524,8 @@
cmd_parms parms;
svav_param_t svav_parms;
ap_directive_t *conftree =3D NULL;
+ SV *dsv =3D Nullsv;
+ const char *filename =3D "mod_perl";
=20
memset(&parms, '\0', sizeof(parms));
=20
@@ -546,11 +556,22 @@
=20
svav_parms.av =3D (AV*)SvRV(lines);
svav_parms.ix =3D 0;
+ svav_parms.skip =3D 0;
#ifdef USE_ITHREADS
svav_parms.perl =3D aTHX;
#endif
=20
- parms.config_file =3D ap_pcfg_open_custom(p, "mod_perl",
+ dsv =3D MP_PERLSECTIONS_DIRECTIVE_SV;
+ if (SvROK(dsv) && sv_derived_from(dsv, "Apache2:irective")) {
+ IV tmp =3D SvIV((SV*)SvRV(dsv));
+ ap_directive_t *directive =3D INT2PTR(ap_directive_t *, tmp);
+ if (directive) {
+ filename =3D directive->filename;
+ svav_parms.skip =3D directive->line_num - 1;
+ }
+ }
+
+ parms.config_file =3D ap_pcfg_open_custom(p, filename,
&svav_parms, NULL,
svav_getstr, NULL);
=20
Index: src/modules/perl/modperl_cmd.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- src/modules/perl/modperl_cmd.c (revision 422775)
+++ src/modules/perl/modperl_cmd.c (working copy)
@@ -559,6 +559,7 @@
=20
{
SV *server =3D MP_PERLSECTIONS_SERVER_SV;
+ SV *dsv =3D MP_PERLSECTIONS_DIRECTIVE_SV;
SV *code =3D newSVpv(arg, 0);
GV *gv =3D gv_fetchpv("0", TRUE, SVt_PV);
ENTER;SAVETMPS;
@@ -567,6 +568,7 @@
TAINT_NOT; /* XXX: temp workaround, see my p5p post */
#endif
sv_setref_pv(server, "Apache2::ServerRec", (void*)s);
+ sv_setref_pv(dsv, "Apache2:irective", (void*)directive);
sv_setpv_mg(GvSV(gv), directive->filename);
eval_sv(code, G_SCALAR|G_KEEPERR);
SvREFCNT_dec(code);
Index: lib/Apache2/PerlSections.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- lib/Apache2/PerlSections.pm (revision 422775)
+++ lib/Apache2/PerlSections.pm (working copy)
@@ -41,6 +41,7 @@
my @saved;
sub save { return $Apache2::PerlSections::Save }
sub server { return $Apache2::PerlSections::Server }
+sub directive { return $Apache2::PerlSections:irective }
sub saved { return @saved }
=20
sub handler : method {

--------------060209070604020100030406--

--------------enig4852C329BAC5B40535CF058A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEu+2ByzKhB4jDpaURA6c6AKCPl3h4ZE30Z5Cc+mC579 3nlraccACgjtbW
nkY3gd6LALMMsJp/9D92kJ8=
=zhXs
-----END PGP SIGNATURE-----

--------------enig4852C329BAC5B40535CF058A--