Re: cvs commit: modperl-2.0/xs/APR/Table APR__Table.h

2001-09-17 Thread Philippe M . Chiasson

Thanks, I'll remember that one... aTHX ;-)

On Sat, Sep 15, 2001 at 06:21:48PM -, [EMAIL PROTECTED] wrote:
 dougm   01/09/15 11:21:48
 
   Modified:xs/APR/Table APR__Table.h
   Log:
   avoid dTHX; in APR::Table-do
   
   Revision  ChangesPath
   1.2   +7 -3  modperl-2.0/xs/APR/Table/APR__Table.h
   
   Index: APR__Table.h
   ===
   RCS file: /home/cvs/modperl-2.0/xs/APR/Table/APR__Table.h,v
   retrieving revision 1.1
   retrieving revision 1.2
   diff -u -r1.1 -r1.2
   --- APR__Table.h2001/09/15 18:17:31 1.1
   +++ APR__Table.h2001/09/15 18:21:48 1.2
   @@ -1,6 +1,7 @@
typedef struct {
SV *cv;
apr_table_t *filter; /*XXX: or maybe a mgv ? */
   +PerlInterpreter *perl;
} mpxs_table_do_cb_data_t;

typedef int (*mpxs_apr_table_do_cb_t)(void *, const char *, const char *);
   @@ -8,10 +9,10 @@
static int mpxs_apr_table_do_cb(void *data,
const char *key, const char *val)
{
   -dTHX; /*XXX*/
   +mpxs_table_do_cb_data_t *tdata = (mpxs_table_do_cb_data_t *)data;
   +dTHXa(tdata-perl);
dSP;
int rv = 0;
   -mpxs_table_do_cb_data_t *tdata = (mpxs_table_do_cb_data_t *)data;

/* Skip completely if something is wrong */
if (!(tdata  tdata-cv  key  val)) {
   @@ -56,7 +57,10 @@
 
tdata.cv = sub;
tdata.filter = NULL;
   -
   +#ifdef USE_ITHREADS
   +tdata.perl = aTHX;
   +#endif
   +
if (items  2) {
STRLEN len;
tdata.filter = apr_table_make(table-a.pool, items-2);
   
   
   
 

-- 
Philippe M. Chiasson  [EMAIL PROTECTED]
  Extropia's Resident System Guru
 http://www.eXtropia.com/

Perl is such a great deal because a lot of people have
worked a great deal on it. 
-- Larry Wall

perl -e '$$=\${gozer};{$_=unpack(P26,pack(L,$$));/^Just Another Perl 
Hacker!\n$/print||$$++redo}'

 PGP signature


cvs commit: modperl-2.0/pod modperl_style.pod

2001-09-17 Thread stas

stas01/09/17 06:28:51

  Removed: pod  modperl_style.pod
  Log:
  migrated to modperl-docs/src/devel/modperl_style/modperl_style.pod



cvs commit: modperl-2.0/todo possible_new_features.txt

2001-09-17 Thread stas

stas01/09/17 09:30:20

  Modified:todo possible_new_features.txt
  Log:
  log a nice-to-have Perl package_foo feature
  
  Revision  ChangesPath
  1.9   +6 -0  modperl-2.0/todo/possible_new_features.txt
  
  Index: possible_new_features.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/possible_new_features.txt,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- possible_new_features.txt 2001/08/10 10:11:31 1.8
  +++ possible_new_features.txt 2001/09/17 16:30:20 1.9
  @@ -9,6 +9,12 @@
   - allow Perl/Perl configuration sections to have read access to internal
 configuration structures (would be nice if we could tie a %namespace::) 
   
  +- allow things like Perl main -- the code will be placed into 'main'
  +  package. Of course any package can be specified and the default is
  +  Apache::ReadConfig. That would place a little meme-fleck into
  +  people's brains to remind them that the default package is
  +  Apache::ReadConfig.
  +
   - setuid/gid before running any Perl code
   
   - implement PerlINC (or similar) as a nicer interface for the working
  
  
  



cvs commit: modperl-2.0/pod modperl_dev.pod

2001-09-17 Thread stas

stas01/09/17 06:53:07

  Modified:pod  modperl_dev.pod
  Log:
  PerlSwitches inherit from base only with +inherit.
  
  Revision  ChangesPath
  1.37  +6 -0  modperl-2.0/pod/modperl_dev.pod
  
  Index: modperl_dev.pod
  ===
  RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- modperl_dev.pod   2001/09/10 07:36:53 1.36
  +++ modperl_dev.pod   2001/09/17 13:53:07 1.37
  @@ -564,6 +564,12 @@
   
   Give the VirtualHost its own interpreter pool.
   
  +Use:
  +
  +  PerlSwitches +inherit
  +
  +to inherit base PerlSwitches.
  +
   =item Enabled
   
   On by default, used to disable mod_perl for a given VirtualHost.
  
  
  



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

2001-09-17 Thread dougm

dougm   01/09/17 16:36:36

  Modified:lib/ModPerl Code.pm
   src/modules/perl mod_perl.c modperl_callback.c
modperl_config.c
  Log:
  s/Enabled/Enable/g for the PerlOption
  
  Revision  ChangesPath
  1.67  +2 -2  modperl-2.0/lib/ModPerl/Code.pm
  
  Index: Code.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- Code.pm   2001/09/15 22:25:55 1.66
  +++ Code.pm   2001/09/17 23:36:35 1.67
  @@ -91,7 +91,7 @@
   my @hook_flags = (map { canon_uc($_) } keys %hooks);
   my @ithread_opts = qw(CLONE PARENT);
   my %flags = (
  -Srv = ['NONE', @ithread_opts, qw(ENABLED AUTOLOAD MERGE_HANDLERS),
  +Srv = ['NONE', @ithread_opts, qw(ENABLE AUTOLOAD MERGE_HANDLERS),
   @hook_flags, 'UNSET'],
   Dir = [qw(NONE PARSE_HEADERS SETUP_ENV MERGE_HANDLERS GLOBAL_REQUEST UNSET)],
   Req = [qw(NONE SET_GLOBAL_REQUEST)],
  @@ -293,7 +293,7 @@
   $protostr
   {
   $prototype-{cfg}-{get};
  -if (!MpSrvENABLED(scfg)) {
  +if (!MpSrvENABLE(scfg)) {
   return apr_pstrcat(parms-pool,
  Perl is disabled for server ,
  parms-server-server_hostname, NULL);
  
  
  
  1.71  +2 -2  modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- mod_perl.c2001/09/16 01:05:44 1.70
  +++ mod_perl.c2001/09/17 23:36:35 1.71
  @@ -135,7 +135,7 @@
   }
   #endif
   
  -if (!MpSrvENABLED(base_scfg)) {
  +if (!MpSrvENABLE(base_scfg)) {
   /* how silly */
   return;
   }
  @@ -170,7 +170,7 @@
   
   #ifdef USE_ITHREADS
   
  -if (!MpSrvENABLED(scfg)) {
  +if (!MpSrvENABLE(scfg)) {
   scfg-mip = NULL;
   continue;
   }
  
  
  
  1.43  +1 -1  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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- modperl_callback.c2001/05/22 22:13:20 1.42
  +++ modperl_callback.c2001/09/17 23:36:36 1.43
  @@ -96,7 +96,7 @@
   const char *desc = NULL;
   AV *av_args = Nullav;
   
  -if (!MpSrvENABLED(scfg)) {
  +if (!MpSrvENABLE(scfg)) {
   MP_TRACE_h(MP_FUNC, PerlOff for server %s\n,
  s-server_hostname);
   return DECLINED;
  
  
  
  1.37  +1 -1  modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- modperl_config.c  2001/09/15 20:17:35 1.36
  +++ modperl_config.c  2001/09/17 23:36:36 1.37
  @@ -68,7 +68,7 @@
   apr_pcalloc(p, sizeof(*scfg));
   
   scfg-flags = modperl_options_new(p, MpSrvType);
  -MpSrvENABLED_On(scfg); /* mod_perl enabled by default */
  +MpSrvENABLE_On(scfg); /* mod_perl enabled by default */
   MpSrvHOOKS_ALL_On(scfg); /* all hooks enabled by default */
   
   scfg-PerlModule  = apr_array_make(p, 2, sizeof(char *));
  
  
  



cvs commit: modperl-2.0/pod modperl_dev.pod

2001-09-17 Thread stas

stas01/09/17 18:36:26

  Modified:pod  modperl_dev.pod
  Log:
  s/Enabled/Enable/ following the code patch
  
  Revision  ChangesPath
  1.38  +1 -1  modperl-2.0/pod/modperl_dev.pod
  
  Index: modperl_dev.pod
  ===
  RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- modperl_dev.pod   2001/09/17 13:53:07 1.37
  +++ modperl_dev.pod   2001/09/18 01:36:26 1.38
  @@ -570,7 +570,7 @@
   
   to inherit base PerlSwitches.
   
  -=item Enabled
  +=item Enable
   
   On by default, used to disable mod_perl for a given VirtualHost.
   
  
  
  



cvs commit: modperl-2.0/t/response/TestDirective - New directory

2001-09-17 Thread stas

stas01/09/17 18:59:35

  modperl-2.0/t/response/TestDirective - New directory



cvs commit: modperl-2.0/t/response/TestDirective perlrequire.pm

2001-09-17 Thread stas

stas01/09/17 19:00:19

  Added:   t/directive perlrequire.t
   t/response/TestDirective perlrequire.pm
  Log:
  - add a PerlRequire test
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/directive/perlrequire.t
  
  Index: perlrequire.t
  ===
  # this test tests PerlRequire configuration directive
  
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest ();
  
  my %checks =
  (
   'default'= 'PerlRequired by Parent',
   'TestDirective::perlrequire' = 'PerlRequired by VirtualHost',
  );
  
  plan tests = scalar keys %checks;
  
  for my $module (sort keys %checks) {
  Apache::TestRequest::module($module);
  
  my $config   = Apache::Test::config();
  my $hostport = Apache::TestRequest::hostport($config);
  print connecting to $hostport\n;
  
  ok t_cmp(
   $checks{$module},
   $config-http_raw_get(/TestDirective::perlrequire, undef),
   testing PerlRequire in $module,
  );
  }
  
  
  
  1.1  modperl-2.0/t/response/TestDirective/perlrequire.pm
  
  Index: perlrequire.pm
  ===
  package TestDirective::perlrequire;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test ();
  use Apache::Const -compile = 'OK';
  use File::Spec::Functions qw(catfile);
  
  sub handler {
  my $r = shift;
  
  $r-content_type('text/plain');
  $r-puts($My::PerlRequireTest::MAGIC || '');
  
  Apache::OK;
  }
  
  my %require_tests = 
  (
   main = 'PerlRequired by Parent',
   vh   = 'PerlRequired by VirtualHost',
  );
  
  sub APACHE_TEST_CONFIGURE {
  my ($class, $self) = @_;
  
  my $vars = $self-{vars};
  my $target_dir = catfile $vars-{documentroot}, 'testdirective';
  
  # create two different PerlRequireTest.pm packages to be loaded by
  # vh and main interpreters, on the fly before the tests start
  while (my($test, $magic) = each %require_tests) {
  my $content = EOF;
  package My::PerlRequireTest;
  \$My::PerlRequireTest::MAGIC = '$magic';
  1;
  EOF
  my $file = catfile $target_dir, $test, 'PerlRequireTest.pm';
  $self-writefile($file, $content, 1);
  }
  }
  
  1;
  __END__
  PerlSwitches -Mlib=@documentroot@/testdirective/main
  PerlRequire PerlRequireTest.pm
  
  VirtualHost TestDirective::perlrequire
  
# a new interpreter pool
PerlOptions +Parent
  
# use test system's @INC
PerlSwitches -Mlib=@serverroot@
PerlRequire conf/modperl_startup.pl
  
PerlSwitches -Mlib=@documentroot@/testdirective/vh
PerlRequire PerlRequireTest.pm
  
Location /TestDirective::perlrequire
   SetHandler modperl
   PerlResponseHandler TestDirective::perlrequire
/Location
  /VirtualHost