httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject [PATCH] Re: TestConfigPerl problem
Date Wed, 19 Mar 2003 15:56:33 GMT
On Tue, Feb 11, 2003 at 10:01:07AM +1100, Stas Bekman wrote:
> Joe Orton wrote:
> >Since rev 1.63 of TestConfigPerl.pm I get this error running TEST (after
> >a fresh checkout)
> >
> >make[1]: Leaving directory `/home/joe/src/httpd-test/pf/c-modules/authany'
> >!!! configure() has failed:
> >Use of uninitialized value in subroutine entry at 
> >/home/joe/src/httpd-test/pf/t/../Apache-Test/lib/Apache/TestConfigPerl.pm 
> >line 318, <GEN48> line 18.
> >
> >backing down to r1.62 works fine. Any ideas? I'm using perl 5.8.0.
> 
> I can't reproduce it. The difference between 1.62 and 1.63 is a big 
> refactoring of the code that parses the config sections.
> 
> Can you please check what is undefined? $line, $indent? Also a trace of 
> calls that leads to this situation will help, which the following patch 
> should accomplish:

I think I've tracked this down: parse_vhost() can return undef when it's
passed a line like "<VirtualHost mod_nntp_like_ssl>" but
parse_vhost_open_tag() assumes otherwise and barfs doing $cfg-> in the
following lines.

This seems to fix it for me (and the config file produced doesn't cause
httpd to barf), is this OK to checkin?

--- Apache-Test/lib/Apache/TestConfigPerl.pm	3 Feb 2003 02:18:32 -0000	1.65
+++ Apache-Test/lib/Apache/TestConfigPerl.pm	19 Mar 2003 15:58:27 -0000
@@ -316,11 +316,15 @@
     my($self, $line, $indent) = @_;
 
     my $cfg = $self->parse_vhost($line);
-    my $port = $cfg->{port};
-    $cfg->{out_postamble}->();
-    $self->postamble("$indent<VirtualHost _default_:$port>");
-    $cfg->{in_postamble}->();
 
+    if (!defined $cfg) {
+        $self->postamble("$indent$line");
+    } else {
+        my $port = $cfg->{port};
+        $cfg->{out_postamble}->();
+        $self->postamble("$indent<VirtualHost _default_:$port>");
+        $cfg->{in_postamble}->();
+    }
 }
 
 #the idea for each group:

Mime
View raw message