cvs commit: modperl-2.0 Makefile.PL

2001-04-12 Thread dougm

dougm   01/04/12 09:03:55

  Modified:.Makefile.PL
  Log:
  make sure test files a cleaned
  
  Revision  ChangesPath
  1.33  +1 -0  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Makefile.PL   2001/04/11 23:00:56 1.32
  +++ Makefile.PL   2001/04/12 16:03:55 1.33
  @@ -234,6 +234,7 @@
   my $self = shift;
   my $string = $self-MM::clean(@_);
   ModPerl::MM::add_dep(\$string, clean = 'modperl_src_clean');
  +ModPerl::MM::add_dep(\$string, clean = 'test_clean');
   $string;
   }
   
  
  
  



cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm

2001-04-12 Thread dougm

dougm   01/04/12 17:47:39

  Modified:Apache-Test/lib/Apache TestConfig.pm
  Log:
  add config for perchild mpm
  
  Revision  ChangesPath
  1.7   +9 -0  modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm
  
  Index: TestConfig.pm
  ===
  RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestConfig.pm 2001/04/12 03:23:58 1.6
  +++ TestConfig.pm 2001/04/13 00:47:38 1.7
  @@ -691,6 +691,15 @@
   MaxRequestsPerChild  0
   /IfModule
   
  +IfModule perchild.c
  +NumServers   1
  +StartThreads 1
  +MinSpareThreads  1
  +MaxSpareThreads  1
  +MaxThreadsPerChild   2
  +MaxRequestsPerChild  0
  +/IfModule
  +
   IfModule prefork.c
   StartServers 1
   MaxClients   1
  
  
  



cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm

2001-04-12 Thread dougm

dougm   01/04/12 17:51:54

  Modified:Apache-Test/lib/Apache TestConfig.pm
  Log:
  forget a few things about the old config
  
  Revision  ChangesPath
  1.8   +2 -0  modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm
  
  Index: TestConfig.pm
  ===
  RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestConfig.pm 2001/04/13 00:47:38 1.7
  +++ TestConfig.pm 2001/04/13 00:51:54 1.8
  @@ -111,6 +111,8 @@
   modules = {},
   inc = [],
   %$thaw,
  +mpm = "",
  +httpd_defines = {},
   vars = $args,
   postamble = [],
   preamble = [],
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_callback.c

2001-04-12 Thread dougm

dougm   01/04/12 18:10:21

  Modified:src/modules/perl modperl_callback.c
  Log:
  log rather than trace failure to resolve handler
  
  Revision  ChangesPath
  1.40  +3 -2  modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- modperl_callback.c2001/04/12 03:49:42 1.39
  +++ modperl_callback.c2001/04/13 01:10:20 1.40
  @@ -36,8 +36,9 @@
  (unsigned long)rp);
   
   if (!modperl_mgv_resolve(aTHX_ handler, rp, handler-name)) {
  -MP_TRACE_h(MP_FUNC, "failed to resolve handler `%s'\n",
  -   handler-name);
  +ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, 
  + "failed to resolve handler `%s'",
  + handler-name);
   return HTTP_INTERNAL_SERVER_ERROR;
   }
   }
  
  
  



cvs commit: modperl-2.0/t/response/TestAPR base64.pm

2001-04-12 Thread dougm

dougm   01/04/12 18:11:28

  Added:   t/response/TestAPR base64.pm
  Log:
  add test for APR::Base64
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/response/TestAPR/base64.pm
  
  Index: base64.pm
  ===
  package TestAPR::base64;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Const -compile = 'OK';
  
  use Apache::Test;
  
  use APR::Base64 ();
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 2;
  
  my $encoded = APR::Base64::encode("$r");
  
  ok $encoded;
  
  my $decoded = APR::Base64::decode($encoded);
  
  ok $decoded eq "$r";
  
  Apache::OK;
  }
  
  1;
  
  
  



cvs commit: modperl-2.0/t/hooks/TestHooks authz.pm

2001-04-12 Thread dougm

dougm   01/04/12 18:26:56

  Added:   t/hooks  authz.t
   t/hooks/TestHooks authz.pm
  Log:
  add PerlAuthzHandler test
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/hooks/authz.t
  
  Index: authz.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  plan tests = 4, \have_lwp;
  
  my $location = "/TestHooks::authz";
  
  ok ! GET_OK $location;
  
  my $rc = GET_RC $location;
  
  ok $rc == 401;
  
  ok GET_OK $location, username = 'dougm', password = 'foo';
  
  ok ! GET_OK $location, username = 'jobbob', password = 'whatever';
  
  
  
  
  
  1.1  modperl-2.0/t/hooks/TestHooks/authz.pm
  
  Index: authz.pm
  ===
  package TestHooks::authz;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Access ();
  use Apache::Const -compile = qw(OK AUTH_REQUIRED);
  
  sub auth_any {
  my $r = shift;
  
  my($res, $sent_pw) = $r-get_basic_auth_pw;
  return $res if $res != Apache::OK;
  
  unless($r-user and $sent_pw) {
$r-note_basic_auth_failure;
return Apache::AUTH_REQUIRED;
  }
  
  return Apache::OK;
  }
  
  sub handler {
  my $r = shift;
  
  my $user = $r-user;
  
  return Apache::AUTH_REQUIRED unless $user;
  
  my($u, @allowed) = split /\s+/, $r-requires-[0]-{requirement};
  
  return Apache::AUTH_REQUIRED unless grep { $_ eq $user } @allowed;
  
  Apache::OK;
  }
  
  1;
  __DATA__
  require user dougm
  AuthType Basic
  AuthName simple
  PerlAuthenHandler   TestHooks::authz::auth_any
  PerlResponseHandler Apache::TestHandler::ok1
  SetHandler modperl
  
  
  



cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm

2001-04-12 Thread dougm

dougm   01/04/12 18:38:38

  Modified:Apache-Test/lib/Apache TestConfigPerl.pm
  Log:
  add a few to the hook config mapping table
  
  Revision  ChangesPath
  1.6   +1 -1  modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm
  
  Index: TestConfigPerl.pm
  ===
  RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestConfigPerl.pm 2001/04/04 17:42:11 1.5
  +++ TestConfigPerl.pm 2001/04/13 01:38:38 1.6
  @@ -210,7 +210,7 @@
   #@INC is auto-modified so each test .pm can be found
   #modules can add their own configuration using __DATA__
   
  -my %hooks = map { $_, ucfirst $_ } qw(authen);
  +my %hooks = map { $_, ucfirst $_ } qw(access authen authz type fixup log);
   $hooks{Protocol} = 'ProcessConnection';
   $hooks{Filter}   = 'OutputFilter';
   
  
  
  



cvs commit: modperl-2.0/t/hooks/TestHooks fixup.pm

2001-04-12 Thread dougm

dougm   01/04/12 18:41:54

  Added:   t/hooks/TestHooks fixup.pm
  Log:
  add a test for PerlFixupHandler
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/hooks/TestHooks/fixup.pm
  
  Index: fixup.pm
  ===
  package TestHooks::fixup;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  
  sub handler {
  my $r = shift;
  
  $r-notes-set(ok = 1);
  
  Apache::OK;
  }
  
  sub response {
  my $r = shift;
  
  plan $r, tests = 1;
  
  ok $r-notes-get('ok');
  
  Apache::OK;
  }
  
  1;
  __DATA__
  PerlResponseHandler TestHooks::fixup::response
  SetHandler modperl
  
  
  



cvs commit: modperl-2.0/t/conf modperl_extra.pl

2001-04-12 Thread dougm

dougm   01/04/12 18:49:58

  Modified:t/conf   modperl_extra.pl
  Log:
  compile common constants at startup so we dont need to in each test module
  
  Revision  ChangesPath
  1.2   +2 -0  modperl-2.0/t/conf/modperl_extra.pl
  
  Index: modperl_extra.pl
  ===
  RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_extra.pl  2001/04/02 09:10:18 1.1
  +++ modperl_extra.pl  2001/04/13 01:49:58 1.2
  @@ -4,4 +4,6 @@
   use Apache::Server ();
   use Apache::Connection ();
   
  +use Apache::Const -compile = ':common';
  +
   1;
  
  
  



cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm

2001-04-12 Thread dougm

dougm   01/04/12 19:04:52

  Modified:Apache-Test/lib/Apache TestConfigPerl.pm
  Log:
  allow PerlTransHandler to be properly configured
  
  Revision  ChangesPath
  1.7   +13 -2 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm
  
  Index: TestConfigPerl.pm
  ===
  RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestConfigPerl.pm 2001/04/13 01:38:38 1.6
  +++ TestConfigPerl.pm 2001/04/13 02:04:52 1.7
  @@ -164,6 +164,7 @@
   
   my %outside_container = map { $_, 1 } qw{
   Alias AliasMatch AddType
  +PerlChildInitHandler PerlTransHandler PerlPostReadRequestHandler
   };
   
   #test .pm's can have configuration after the __DATA__ token
  @@ -210,7 +211,8 @@
   #@INC is auto-modified so each test .pm can be found
   #modules can add their own configuration using __DATA__
   
  -my %hooks = map { $_, ucfirst $_ } qw(access authen authz type fixup log);
  +my %hooks = map { $_, ucfirst $_ }
  +  qw(trans access authen authz type fixup log);
   $hooks{Protocol} = 'ProcessConnection';
   $hooks{Filter}   = 'OutputFilter';
   
  @@ -250,8 +252,17 @@
   }
   
   my $container = $container_config{$hook} || \location_container;
  +my @handler_cfg = ($handler = $module);
  +
  +if ($outside_container{$handler}) {
  +$self-postamble(@handler_cfg);
  +}
  +else {
  +push @args, @handler_cfg;
  +}
  +
   $self-postamble($self-$container($module),
  - { $handler = $module, @args });
  + { @args }) if @args;
   
   $self-write_pm_test($module, lc $base, lc $sub);
   }, $dir);