cvs commit: modperl-site index.html

2001-10-16 Thread stas

stas01/10/16 01:16:36

  Modified:.index.html
  Log:
  - add the link to the asp mail archive
  
  Revision  ChangesPath
  1.90  +1 -0  modperl-site/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/modperl-site/index.html,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- index.html2001/10/16 04:52:32 1.89
  +++ index.html2001/10/16 08:16:35 1.90
  @@ -1047,6 +1047,7 @@
  ul   
   
li
  +at a 
href=http://www.mail-archive.com/asp%40perl.apache.org/;mail-archive.com/a.
/li
   
  /ul
  
  
  



cvs commit: modperl-2.0/t/response/TestModperl interp.pm

2001-10-16 Thread dougm

dougm   01/10/16 20:20:02

  Added:   t/modperl interp.t
   t/response/TestModperl interp.pm
  Log:
  add a test that uses the same interpreter each time
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/modperl/interp.t
  
  Index: interp.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  use constant INTERP = 'X-PerlInterpreter';
  
  plan tests = 3, \have_lwp;
  
  my $url = /TestModperl::interp;
  
  #request an interpreter instance
  my $res = GET $url, INTERP, 'init';
  
  #use this interpreter id to select the same interpreter in requests below
  my $interp = $res-header(INTERP);
  
  print using interp: $interp\n;
  
  print $res-content;
  
  my $found_interp = ;
  my $find_interp = sub {
  $res-code == 200 and (($found_interp = $res-header(INTERP)) eq $interp);
  };
  
  for (1..2) {
  my $times = 0;
  
  do {
  #loop until we get a response from our interpreter instance
  $res = GET $url, INTERP, $interp;
  
  #trace info
  unless ($find_interp-()) {
  print $found_interp ?
wrong interpreter: $found_interp\n :
no interpreter\n;
  }
  
  if ($times++  15) { #prevent endless loop
  die unable to find interp $interp\n;
  }
  } while (not $find_interp-());
  
  print $res-content; #ok $value++
  }
  
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/interp.pm
  
  Index: interp.pm
  ===
  package TestModperl::interp;
  
  use warnings FATAL = 'all';
  use strict;
  
  use APR::UUID ();
  use Apache::Const -compile = qw(OK NOT_FOUND SERVER_ERROR);
  
  use constant INTERP = 'X-PerlInterpreter';
  
  my $interp_id = ;
  my $value = 0;
  
  sub fixup {
  my $r = shift;
  my $interp = $r-headers_in-get(INTERP);
  my $rc = Apache::OK;
  
  unless ($interp) {
  #shouldn't be requesting this without an INTERP header
  return Apache::SERVER_ERROR;
  }
  
  my $id = $interp_id;
  if ($interp eq 'init') { #first request for an interpreter instance
  #unique id for this instance
  $interp_id = $id = APR::UUID-new-format;
  $value = 0; #reset our global data
  }
  elsif ($interp ne $interp_id) {
  #this is not the request interpreter instance
  $rc = Apache::NOT_FOUND;
  }
  
  #so client can save the created instance id or check the existing value
  $r-headers_out-set(INTERP, $id);
  
  return $rc;
  }
  
  sub handler {
  my $r = shift;
  
  #test the actual global data
  $value++;
  $r-puts(ok $value\n);
  
  Apache::OK;
  }
  
  1;
  __END__
  PerlFixupHandler TestModperl::interp::fixup
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2001-10-16 Thread stas

stas01/10/16 22:35:34

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  - add a D_NONE const
  - now the DEBUG const can be overriden from httpd.conf
  
  Revision  ChangesPath
  1.2   +10 -7 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryCooker.pm 2001/10/09 12:47:38 1.1
  +++ RegistryCooker.pm 2001/10/17 05:35:34 1.2
  @@ -49,20 +49,23 @@
   # - see META's accross the file
   
   #
  -# debug flag constants
  +# debug constants
   #
   #
  +use constant D_NONE= 0;
   use constant D_ERROR   = 1;
   use constant D_WARN= 2;
   use constant D_COMPILE = 4;
   use constant D_NOISE   = 8;
   
  -# use ModPerl::RegistryCooker::DEBUG constant if defined elsewhere
  -# before the compilation of this package: D_NOISE devel mode (prod==0)
  -#use constant DEBUG = ModPerl::RegistryCooker-can('DEBUG') || D_NOISE;
  -#use Apache::ServerUtil;
  -#use constant DEBUG = defined 
Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG') ? 
Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG') : D_NOISE;
  -use constant DEBUG = D_NOISE;
  +# can override the debug level in httpd.conf with:
  +#   PerlSetVar ModPerl::RegistryCooker::DEBUG 4
  +# on the server level 
  +use Apache::ServerUtil ();
  +use constant DEBUG =
  +defined Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG')
  +? Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG')
  +: D_NONE;
   
   #
   # object's array index's access constants