perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0/t/filter/TestFilter in_bbs_body.pm in_bbs_consume.pm in_bbs_inject_header.pm in_bbs_msg.pm in_bbs_underrun.pm out_bbs_basic.pm out_bbs_ctx.pm
Date Fri, 21 May 2004 18:40:50 GMT
stas        2004/05/21 11:40:50

  Modified:    t/conf   modperl_extra.pl
               t/filter/TestFilter in_bbs_body.pm in_bbs_consume.pm
                        in_bbs_inject_header.pm in_bbs_msg.pm
                        in_bbs_underrun.pm out_bbs_basic.pm out_bbs_ctx.pm
  Log:
  adjust tests to handle the new bucket->read() API and a new module
  APR::BucketType
  
  Revision  Changes    Path
  1.48      +3 -6      modperl-2.0/t/conf/modperl_extra.pl
  
  Index: modperl_extra.pl
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -u -r1.47 -r1.48
  --- modperl_extra.pl	29 Apr 2004 00:19:35 -0000	1.47
  +++ modperl_extra.pl	21 May 2004 18:40:49 -0000	1.48
  @@ -149,7 +149,6 @@
           warn "read_post: bb $count\n" if $debug;
   
           while (!$bb->empty) {
  -            my $buf;
               my $b = $bb->first;
   
               $b->remove;
  @@ -160,10 +159,7 @@
                   last;
               }
   
  -            my $status = $b->read($buf);
  -            if ($status != APR::SUCCESS) {
  -                return $status;
  -            }
  +            my $buf = $b->read;
               warn "read_post: DATA bucket: [$buf]\n" if $debug;
               push @data, $buf;
           }
  @@ -220,6 +216,7 @@
   use Apache::FilterRec ();
   use APR::Brigade ();
   use APR::Bucket ();
  +use APR::BucketType ();
   
   use Apache::Const -compile => qw(OK DECLINED);
   use APR::Const -compile => ':common';
  @@ -266,7 +263,7 @@
   
       my @data;
       for (my $b = $bb->first; $b; $b = $bb->next($b)) {
  -        $b->read(my $bdata);
  +        my $bdata = $b->read;
           $bdata = '' unless defined $bdata;
           push @data, $b->type->name, $bdata;
       }
  
  
  
  1.3       +1 -8      modperl-2.0/t/filter/TestFilter/in_bbs_body.pm
  
  Index: in_bbs_body.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_body.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- in_bbs_body.pm	31 Mar 2003 01:50:51 -0000	1.2
  +++ in_bbs_body.pm	21 May 2004 18:40:50 -0000	1.3
  @@ -28,7 +28,6 @@
       }
   
       while (!$ctx_bb->empty) {
  -        my $data;
           my $bucket = $ctx_bb->first;
   
           $bucket->remove;
  @@ -39,13 +38,7 @@
               last;
           }
   
  -        my $status = $bucket->read($data);
  -        #warn "DATA bucket!!!!";
  -        if ($status != APR::SUCCESS) {
  -            return $status;
  -        }
  -
  -        if ($data) {
  +        if (my $data = $bucket->read) {
               #warn"[$data]\n";
               $bucket = APR::Bucket->new(scalar reverse $data);
           }
  
  
  
  1.3       +1 -1      modperl-2.0/t/filter/TestFilter/in_bbs_consume.pm
  
  Index: in_bbs_consume.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_consume.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- in_bbs_consume.pm	18 Sep 2003 08:09:06 -0000	1.2
  +++ in_bbs_consume.pm	21 May 2004 18:40:50 -0000	1.3
  @@ -75,7 +75,7 @@
       my @data;
       for (my $b = $bb->first; $b; $b = $bb->next($b)) {
           $seen_eos++, last if $b->is_eos;
  -        $b->read(my $bdata);
  +        my $bdata = $b->read;
           $bdata = '' unless defined $bdata;
           push @data, $bdata;
       }
  
  
  
  1.7       +2 -5      modperl-2.0/t/filter/TestFilter/in_bbs_inject_header.pm
  
  Index: in_bbs_inject_header.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_inject_header.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- in_bbs_inject_header.pm	2 Mar 2004 06:08:00 -0000	1.6
  +++ in_bbs_inject_header.pm	21 May 2004 18:40:50 -0000	1.7
  @@ -63,8 +63,7 @@
   
       if (1) {
           # extra debug, wasting cycles
  -        my $data;
  -        $bucket->read($data);
  +        my $data = $bucket->read;
           debug "injected header: [$data]";
       }
       else {
  @@ -157,7 +156,6 @@
       return $rv unless $rv == APR::SUCCESS;
   
       while (!$ctx_bb->empty) {
  -        my $data;
           my $bucket = $ctx_bb->first;
   
           $bucket->remove;
  @@ -168,9 +166,8 @@
               last;
           }
   
  -        my $status = $bucket->read($data);
  +        my $data = $bucket->read;
           debug "filter read:\n[$data]";
  -        return $status unless $status == APR::SUCCESS;
   
           # check that we really work only on the headers
           die "This filter should not ever receive the request body, " .
  
  
  
  1.7       +1 -6      modperl-2.0/t/filter/TestFilter/in_bbs_msg.pm
  
  Index: in_bbs_msg.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_msg.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- in_bbs_msg.pm	9 Feb 2004 18:18:16 -0000	1.6
  +++ in_bbs_msg.pm	21 May 2004 18:40:50 -0000	1.7
  @@ -32,7 +32,6 @@
       }
   
       while (!$ctx_bb->empty) {
  -        my $data;
           my $bucket = $ctx_bb->first;
   
           $bucket->remove;
  @@ -43,12 +42,8 @@
               last;
           }
   
  -        my $status = $bucket->read($data);
  +        my $data = $bucket->read;
           debug "FILTER READ:\n$data";
  -
  -        if ($status != APR::SUCCESS) {
  -            return $status;
  -        }
   
           if ($data and $data =~ s,GET $from_url,GET $to_url,) {
               debug "GET line rewritten to be:\n$data";
  
  
  
  1.6       +1 -1      modperl-2.0/t/filter/TestFilter/in_bbs_underrun.pm
  
  Index: in_bbs_underrun.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_underrun.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- in_bbs_underrun.pm	18 Sep 2003 08:09:06 -0000	1.5
  +++ in_bbs_underrun.pm	21 May 2004 18:40:50 -0000	1.6
  @@ -121,7 +121,7 @@
       my @data;
       for (my $b = $bb->first; $b; $b = $bb->next($b)) {
           $seen_eos++, last if $b->is_eos;
  -        $b->read(my $bdata);
  +        my $bdata = $b->read;
           $bdata = '' unless defined $bdata;
           push @data, $bdata;
       }
  
  
  
  1.4       +2 -1      modperl-2.0/t/filter/TestFilter/out_bbs_basic.pm
  
  Index: out_bbs_basic.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_bbs_basic.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- out_bbs_basic.pm	24 Apr 2003 04:29:06 -0000	1.3
  +++ out_bbs_basic.pm	21 May 2004 18:40:50 -0000	1.4
  @@ -10,6 +10,7 @@
   use Apache::Filter ();
   use APR::Brigade ();
   use APR::Bucket ();
  +use APR::BucketType ();
   
   use Apache::Const -compile => 'OK';
   
  @@ -31,7 +32,7 @@
           for (my $bucket = $bb->first; $bucket; $bucket = $bb->next($bucket)) {
               ok $bucket->type->name;
               ok $bucket->length == 2;
  -            $bucket->read(my $data);
  +            my $data = $bucket->read;
               ok (defined $data and $data eq 'ok');
           }
   
  
  
  
  1.5       +1 -3      modperl-2.0/t/filter/TestFilter/out_bbs_ctx.pm
  
  Index: out_bbs_ctx.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_bbs_ctx.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- out_bbs_ctx.pm	31 Mar 2003 01:50:51 -0000	1.4
  +++ out_bbs_ctx.pm	21 May 2004 18:40:50 -0000	1.5
  @@ -43,9 +43,7 @@
               last;
           }
   
  -        my $status = $bucket->read(my $bdata);
  -        return $status unless $status == APR::SUCCESS;
  -
  +        my $bdata = $bucket->read;
           if (defined $bdata) {
               $data .= $bdata;
               my $len = length $data;
  
  
  

Mime
View raw message