cvs commit: modperl-2.0/lib/Apache compat.pm

2004-09-13 Thread gozer
gozer   2004/09/13 17:08:27

  Modified:lib/Apache compat.pm
  Log:
  delayed loading of Apache::Module for compat is not necessary
  
  Revision  ChangesPath
  1.121 +1 -2  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- compat.pm 14 Sep 2004 00:04:51 -  1.120
  +++ compat.pm 14 Sep 2004 00:08:27 -  1.121
  @@ -38,6 +38,7 @@
   use Apache::ServerRec ();
   use Apache::ServerUtil ();
   use Apache::Access ();
  +use Apache::Module ();
   use Apache::RequestRec ();
   use Apache::RequestIO ();
   use Apache::RequestUtil ();
  @@ -265,7 +266,6 @@
   }
   
   {
  -require Apache::Module;
   my $orig_sub = *Apache::Module::top_module{CODE};
   *Apache::Module::top_module = sub {
   $orig_sub-();
  @@ -273,7 +273,6 @@
   }
   
   {
  -require Apache::Module;
   my $orig_sub = *Apache::Module::get_config{CODE};
   *Apache::Module::get_config = sub {
   shift if $_[0] eq 'Apache::Module';
  
  
  


cvs commit: modperl-2.0/lib/Apache compat.pm

2004-06-04 Thread stas
stas2004/06/04 02:34:46

  Modified:lib/Apache compat.pm
  Log:
  rewrite content() not to use the deprecated and limping
  should_client_block and friends
  
  Revision  ChangesPath
  1.107 +28 -9 modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -u -r1.106 -r1.107
  --- compat.pm 22 May 2004 21:47:32 -  1.106
  +++ compat.pm 4 Jun 2004 09:34:46 -   1.107
  @@ -51,6 +51,8 @@
   use APR::Pool ();
   use APR::URI ();
   use APR::Util ();
  +use APR::Brigade ();
  +use APR::Bucket ();
   use mod_perl ();
   use Symbol ();
   
  @@ -471,23 +473,40 @@
   return $r-parse_args($args);
   }
   
  +use Apache::Const -compile = qw(MODE_READBYTES);
  +use APR::Const-compile = qw(SUCCESS BLOCK_READ);
  +
   use constant IOBUFSIZE = 8192;
   
   sub content {
   my $r = shift;
   
  -$r-setup_client_block;
  -
  -return undef unless $r-should_client_block;
  +my $ba = $r-connection-bucket_alloc;
  +my $bb = APR::Brigade-new($r-pool, $ba);
   
   my $data = '';
  -my $buf;
  -while (my $read_len = $r-get_client_block($buf, IOBUFSIZE)) {
  -if ($read_len == -1) {
  -die some error while reading with get_client_block;
  +my $seen_eos = 0;
  +my $count = 0;
  +do {
  +$r-input_filters-get_brigade($bb,
  +Apache::MODE_READBYTES, APR::BLOCK_READ, IOBUFSIZE);
  +
  +while (!$bb-is_empty) {
  +my $b = $bb-first;
  +
  +$b-remove;
  +
  +if ($b-is_eos) {
  +$seen_eos++;
  +last;
  +}
  +
  +my $buf = $b-read;
  +$data .= $buf if length $buf;
   }
  -$data .= $buf;
  -}
  +} while (!$seen_eos);
  +
  +$bb-destroy;
   
   return $data unless wantarray;
   return $r-parse_args($data);
  
  
  


cvs commit: modperl-2.0/lib/Apache compat.pm

2003-08-14 Thread stas
stas2003/08/05 09:00:24

  Modified:lib/Apache compat.pm
  Log:
  typo
  
  Revision  ChangesPath
  1.87  +1 -1  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- compat.pm 28 Jul 2003 10:33:58 -  1.86
  +++ compat.pm 5 Aug 2003 16:00:24 -   1.87
  @@ -357,7 +357,7 @@
   #XXX: would like to have a proper implementation
   #that reads line-by-line as defined by $/
   #the best way will probably be to use perlio in 5.8.0
  -#anything else would be more effort that it is worth
  +#anything else would be more effort than it is worth
   sub READLINE {
   my $r = shift;
   my $line;