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 context_stream.t context.t
Date Sun, 12 Jan 2003 04:18:00 GMT
stas        2003/01/11 20:18:00

  Modified:    t/filter/TestFilter context_stream.pm context.pm
               t/filter context_stream.t context.t
  Log:
  - send more data (=> more chunks) to run a better test
  - more cleanups
  
  Revision  Changes    Path
  1.3       +2 -3      modperl-2.0/t/filter/TestFilter/context_stream.pm
  
  Index: context_stream.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/context_stream.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- context_stream.pm	12 Jan 2003 04:11:53 -0000	1.2
  +++ context_stream.pm	12 Jan 2003 04:18:00 -0000	1.3
  @@ -65,14 +65,13 @@
   
       $r->content_type('text/plain');
   
  -    # make sure that 
  +    # make sure that
       # - we send big enough data so it won't fit into one buffer
       # - use chunk size which doesn't nicely fit into a buffer size, so
       #   we have something to store in the context between filter calls
   
  -    my $blocks = 11;
  +    my $blocks = 33;
       my $block_size = BLOCK_SIZE + 1;
  -    # embed \n, so there will be several buckets
       my $block = "x" x $block_size;
       for (1..$blocks) {
           $r->print($block);
  
  
  
  1.3       +1 -44     modperl-2.0/t/filter/TestFilter/context.pm
  
  Index: context.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/context.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- context.pm	12 Jan 2003 04:11:53 -0000	1.2
  +++ context.pm	12 Jan 2003 04:18:00 -0000	1.3
  @@ -73,48 +73,6 @@
       return Apache::OK;
   }
   
  -sub handler1 {
  -    my $filter = shift;
  -
  -    my $ctx = $filter->ctx;
  -
  -    $ctx->{invoked}++;
  -
  -    my ($data, $len) = (exists $ctx->{leftover} && length $ctx->{leftover})
  -        ? ($ctx->{leftover}, $ctx->{leftover_len})
  -        : ('', 0);
  -
  -    while (my $read_len = $filter->read(my $buffer, 1024)) {
  -        $len += $read_len;
  -        $data .= $buffer;
  -        if ($len >= BLOCK_SIZE) {
  -            my $blocks = int($len / BLOCK_SIZE);
  -            warn "len $len, $read_len, blocks $blocks\n";
  -            $len = $len % BLOCK_SIZE;
  -            warn "len $len ", length($data), "\n";
  -            $data = substr $data, $blocks*BLOCK_SIZE, $len;
  -            $ctx->{blocks} += $blocks;
  -            $filter->print("#" x $blocks);
  -        }
  -    }
  -
  -#
  -#    # there shouldn't be any leftovers in our test
  -#    if ($filter->eos) {
  -#        if ($len) {
  -#            $filter->print("?");
  -#        }
  -#        $filter->print("sig: $blocks blocks");
  -#    }
  -#    else {
  -        $ctx->{leftover}     = $data;
  -        $ctx->{leftover_len} = $len;
  -        $filter->ctx($ctx);
  -#    }
  -
  -    return Apache::OK;
  -}
  -
   sub response {
       my $r = shift;
   
  @@ -125,9 +83,8 @@
       # - use chunk size which doesn't nicely fit into a buffer size, so
       #   we have something to store in the context between filter calls
   
  -    my $blocks = 11;
  +    my $blocks = 33;
       my $block_size = BLOCK_SIZE + 1;
  -    # embed \n, so there will be several buckets
       my $block = "x" x $block_size;
       for (1..$blocks) {
           $r->print($block);
  
  
  
  1.2       +2 -2      modperl-2.0/t/filter/context_stream.t
  
  Index: context_stream.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/context_stream.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- context_stream.t	12 Jan 2003 04:03:02 -0000	1.1
  +++ context_stream.t	12 Jan 2003 04:18:00 -0000	1.2
  @@ -7,8 +7,8 @@
   
   plan tests => 1;
   
  -my $blocks  = 11;
  -my $invoked = 34;
  +my $blocks  = 33;
  +my $invoked = 100;
   my $sig = join "\n", "received $blocks complete blocks",
       "filter invoked $invoked times\n";
   my $data = "#" x $blocks . "x" x $blocks;
  
  
  
  1.2       +2 -2      modperl-2.0/t/filter/context.t
  
  Index: context.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/context.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- context.t	12 Jan 2003 04:03:02 -0000	1.1
  +++ context.t	12 Jan 2003 04:18:00 -0000	1.2
  @@ -7,8 +7,8 @@
   
   plan tests => 1;
   
  -my $blocks  = 11;
  -my $invoked = 34;
  +my $blocks  = 33;
  +my $invoked = 100;
   my $sig = join "\n", "received $blocks complete blocks",
       "filter invoked $invoked times\n";
   my $data = "#" x $blocks . "x" x $blocks;
  
  
  

Mime
View raw message