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 Changes
Date Mon, 12 Jul 2004 07:32:07 GMT
stas        2004/07/12 00:32:07

  Modified:    xs/APR/Bucket APR__Bucket.h
               xs/Apache/Filter Apache__Filter.h
               xs/Apache/RequestIO Apache__RequestIO.h
               .        Changes
  Added:       t/apache read2.t
               t/response/TestApache read2.pm
  Log:
  Fix ($r|$filter|$bucket)->read() functions to run the set magic logic,
  to handle cases when a passed buffer to fill is not a regular
  scalar.
  
  Revision  Changes    Path
  1.1                  modperl-2.0/t/apache/read2.t
  
  Index: read2.t
  ===================================================================
  use Apache::TestRequest 'POST_BODY_ASSERT';
  print POST_BODY_ASSERT "/TestApache__read2",
      content => "foobar";
  
  
  
  1.1                  modperl-2.0/t/response/TestApache/read2.pm
  
  Index: read2.pm
  ===================================================================
  package TestApache::read2;
  
  # extra tests in addition to TestApache::read
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  use APR::Table ();
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::Const -compile => qw(OK);
  
  my $expected = "foobar";
  
  sub handler {
      my $r = shift;
  
      plan $r, tests => 1;
  
      # test the case where the buffer to be filled has set magic
      # attached. which is the case when one passes an non-existing hash
      # entry value. it's not autovivified when passed to the function
      # and it's not undef. running SetMAGIC inside read accomplishes
      # the autovivication in this particular case.
      my $data;
      my $len = $r->read($data->{buffer}, $r->headers_in->{'Content-Length'});
  
      ok t_cmp($data->{buffer},
               $expected,
               "reading into an autovivified hash entry");
  
      Apache::OK;
  }
  1;
  
  
  
  
  1.12      +4 -0      modperl-2.0/xs/APR/Bucket/APR__Bucket.h
  
  Index: APR__Bucket.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -u -r1.11 -r1.12
  --- APR__Bucket.h	13 Jun 2004 05:39:08 -0000	1.11
  +++ APR__Bucket.h	12 Jul 2004 07:32:07 -0000	1.12
  @@ -50,6 +50,10 @@
       }
   
       sv_setpvn(buffer, (len ? str : ""), len);
  +
  +    /* must run any set magic */
  +    SvSETMAGIC(buffer);
  +    
       return len;
   }
   
  
  
  
  1.41      +3 -0      modperl-2.0/xs/Apache/Filter/Apache__Filter.h
  
  Index: Apache__Filter.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -u -r1.40 -r1.41
  --- Apache__Filter.h	2 Jun 2004 18:49:22 -0000	1.40
  +++ Apache__Filter.h	12 Jul 2004 07:32:07 -0000	1.41
  @@ -77,6 +77,9 @@
           len = modperl_output_filter_read(aTHX_ modperl_filter, buffer, wanted);
       }
   
  +    /* must run any set magic */
  +    SvSETMAGIC(buffer);
  +    
       return len;
   }
   
  
  
  
  1.53      +6 -0      modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -u -r1.52 -r1.53
  --- Apache__RequestIO.h	2 Jul 2004 23:20:47 -0000	1.52
  +++ Apache__RequestIO.h	12 Jul 2004 07:32:07 -0000	1.53
  @@ -199,6 +199,9 @@
           sv_setpvn(buffer, "", 0);
       }
   
  +    /* must run any set magic */
  +    SvSETMAGIC(buffer);
  +
       return nrd;
   }
   
  @@ -253,6 +256,9 @@
       else {
           sv_setpvn(bufsv, "", 0);
       }
  +
  +    /* must run any set magic */
  +    SvSETMAGIC(bufsv);
   
       return newSViv(total);
   }
  
  
  
  1.408     +4 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.407
  retrieving revision 1.408
  diff -u -u -r1.407 -r1.408
  --- Changes	10 Jul 2004 00:37:06 -0000	1.407
  +++ Changes	12 Jul 2004 07:32:07 -0000	1.408
  @@ -12,6 +12,10 @@
   
   =item 1.99_15-dev
   
  +Fix ($r|$filter|$bucket)->read() functions to run the set magic logic,
  +to handle cases when a passed buffer to fill is not a regular
  +scalar. [Stas]
  +
   Apache::ServerRec accessors changes: [Stas]
   - readonly accessors:
   
  
  
  

Mime
View raw message