perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/t/filter/TestFilter input_body.pm
Date Tue, 06 Nov 2001 00:07:53 GMT
dougm       01/11/05 16:07:53

  Modified:    t/filter/TestFilter input_body.pm
  Log:
  change filter logic to what is currently considered the "right way"
  
  Revision  Changes    Path
  1.7       +18 -10    modperl-2.0/t/filter/TestFilter/input_body.pm
  
  Index: input_body.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_body.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- input_body.pm	2001/08/10 03:06:45	1.6
  +++ input_body.pm	2001/11/06 00:07:53	1.7
  @@ -15,28 +15,36 @@
   sub handler : FilterRequestHandler {
       my($filter, $bb, $mode, $readbytes) = @_;
   
  -    if ($bb->empty) {
  -        my $rv = $filter->next->get_brigade($bb, $mode, $readbytes);
  +    my $ctx_bb = APR::Brigade->new($filter->r->pool);
   
  -        if ($rv != APR::SUCCESS) {
  -            return $rv;
  -        }
  +    my $rv = $filter->next->get_brigade($ctx_bb, $mode, $readbytes);
  +
  +    if ($rv != APR::SUCCESS) {
  +        return $rv;
       }
   
  -    while (!$bb->empty) {
  -        my $bucket = $bb->first;
  +    while (!$ctx_bb->empty) {
           my $data;
  -        my $status = $bucket->read($data);
  +        my $bucket = $ctx_bb->first;
   
           $bucket->remove;
   
  +        if ($bucket->is_eos) {
  +            $bb->insert_tail($bucket);
  +            last;
  +        }
  +
  +        my $status = $bucket->read($data);
  +
  +        if ($status != APR::SUCCESS) {
  +            return $status;
  +        }
  +
           if ($data) {
               $bucket = APR::Bucket->new(scalar reverse $data);
           }
   
           $bb->insert_tail($bucket);
  -
  -        last if $bucket->is_eos;
       }
   
       Apache::OK;
  
  
  

Mime
View raw message