You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by do...@apache.org on 2002/03/07 05:00:13 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

dougm       02/03/06 20:00:13

  Modified:    perl-framework/Apache-Test/lib/Apache TestRequest.pm
  Log:
  if we die due to invalid protocol do it after debug info is printed
  
  Revision  Changes    Path
  1.64      +5 -2      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
  
  Index: TestRequest.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- TestRequest.pm	20 Dec 2001 03:51:11 -0000	1.63
  +++ TestRequest.pm	7 Mar 2002 04:00:13 -0000	1.64
  @@ -360,6 +360,7 @@
       my($name, $shortcut) = (shift, shift);
   
       my $r = (\&{$name})->(@_);
  +    my $error = "";
   
       unless ($shortcut) {
           #GET, HEAD, POST
  @@ -367,10 +368,10 @@
           my $proto = $r->protocol;
           if (defined($proto)) {
               if ($proto !~ /^HTTP\/(\d\.\d)$/) {
  -                die "response had no protocol (is LWP broken or something?)";
  +                $error = "response had no protocol (is LWP broken or something?)";
               }
               if ($1 ne "1.0" && $1 ne "1.1") {
  -                die "response had protocol HTTP/$1 (headers not sent?)";
  +                $error = "response had protocol HTTP/$1 (headers not sent?)";
               }
           }
       }
  @@ -382,6 +383,8 @@
           print "$name $url:\n", $r->request->headers_as_string, "\n";
           print lwp_as_string($r, $DebugLWP > 1);
       }
  +
  +    die $error if $error;
   
       return $shortcut ? $r->$shortcut() : $r;
   }