if $Apache::Server::StrictPerlSections is true, syntax error in <Perl > sections aborts server startup, otherwise, you only get a warning.
$Id: Apache-Server-StrictPerlSections.patch,v 1.2 2003/02/26 05:07:17 gozer Exp $
Index: STATUS
===================================================================
RCS file: /home/cvspublic/modperl-2.0/STATUS,v
retrieving revision 1.34
diff -u -I'$Id' -I'$Revision' -r1.34 STATUS
--- STATUS 20 Feb 2003 00:41:51 -0000 1.34
+++ STATUS 26 Feb 2003 05:04:35 -0000
@@ -154,7 +154,6 @@
* Apache::PerlSections missing features for backwards compatibility:
- $Apache::Server::SaveConfig
- $Apache::ReadConfig::DocumentRoot
- - $Apache::Server::StrictPerlSections
- Apache::PerlSections->store(filename)
Report: Philippe M. Chiasson <[EMAIL PROTECTED]>
Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.37
diff -u -I'$Id' -I'$Revision' -r1.37 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c 21 Dec 2002 03:46:07 -0000 1.37
+++ src/modules/perl/modperl_cmd.c 26 Feb 2003 05:04:36 -0000
@@ -316,6 +316,8 @@
#define MP_DEFAULT_PERLSECTION_HANDLER "Apache::PerlSection"
#define MP_DEFAULT_PERLSECTION_PACKAGE "Apache::ReadConfig"
+#define MP_STRICT_PERLSECTIONS_SV \
+perl_get_sv("Apache::Server::StrictPerlSections", FALSE)
MP_CMD_SRV_DECLARE(perldo)
{
@@ -327,6 +329,7 @@
const char *package_name = NULL;
int status = OK;
AV *args = Nullav;
+ SV *sv;
#ifdef USE_ITHREADS
MP_dSCFG(s);
pTHX;
@@ -369,7 +372,16 @@
eval_pv(arg, FALSE);
if (SvTRUE(ERRSV)) {
- return SvPVX(ERRSV);
+ if ((sv = MP_STRICT_PERLSECTIONS_SV) && SvTRUE(sv)) {
+ return SvPVX(ERRSV);
+ }
+ else {
+ modperl_log_warn(s, apr_psprintf(p, "Syntax error at %s:%d %s",
+ parms->directive->filename,
+ parms->directive->line_num,
+ SvPVX(ERRSV)));
+
+ }
}
if (handler) {
--------------------------------------------------------------------------------
Philippe M. Chiasson /[EMAIL PROTECTED](x|X)tropia\.com/ 88C3A5A5
(122FF51B/C634E37B)
http://www.eXtropia.com/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
88C3 A5A5
signature.asc
Description: This is a digitally signed message part
