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

2001-11-06 Thread dougm

dougm   01/11/06 10:39:41

  Modified:src/modules/perl modperl_util.c modperl_util.h
  Log:
  add modperl_perl_do_sprintf function
  
  Revision  ChangesPath
  1.30  +16 -0 modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- modperl_util.c2001/11/05 05:12:33 1.29
  +++ modperl_util.c2001/11/06 18:39:41 1.30
  @@ -443,6 +443,22 @@
   return 0;
   }
   
  +/* XXX: same as Perl_do_sprintf(); 
  + * but Perl_do_sprintf() is not part of the public api
  + */
  +void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
  +{
  +STRLEN patlen;
  +char *pat = SvPV(*sarg, patlen);
  +bool do_taint = FALSE;
  +
  +sv_vsetpvfn(sv, pat, patlen, Null(va_list*), sarg + 1, len - 1, do_taint);
  +SvSETMAGIC(sv);
  +if (do_taint) {
  +SvTAINTED_on(sv);
  +}
  +}
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name)
   {
   I32 i, oldscope = PL_scopestack_ix;
  
  
  
  1.30  +2 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- modperl_util.h2001/10/27 17:14:17 1.29
  +++ modperl_util.h2001/11/06 18:39:41 1.30
  @@ -98,6 +98,8 @@
   #define hv_fetch_he(hv,k,l,h) \
   modperl_perl_hv_fetch_he(aTHX_ hv, k, l, h)
   
  +void modperl_perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg);
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name);
   
   void modperl_perl_exit(pTHX_ int status);
  
  
  



cvs commit: modperl-2.0/xs/maps apache_functions.map modperl_functions.map

2001-11-06 Thread dougm

dougm   01/11/06 10:41:46

  Modified:todo api.txt
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/maps  apache_functions.map modperl_functions.map
  Log:
  add Apache::RequestIO::{printf,PRINTF} methods
  
  Revision  ChangesPath
  1.13  +1 -1  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- api.txt   2001/10/29 01:19:16 1.12
  +++ api.txt   2001/11/06 18:41:46 1.13
  @@ -3,7 +3,7 @@
   --
   
   tied filehandle interface:
  - -CLOSE, GETC, PRINTF, READLINE
  + -CLOSE, GETC, READLINE
   
   $r-finfo:
   need apr_finfo_t - struct stat conversion (might already be there,
  
  
  
  1.18  +30 -1 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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Apache__RequestIO.h   2001/11/06 17:50:56 1.17
  +++ Apache__RequestIO.h   2001/11/06 18:41:46 1.18
  @@ -1,7 +1,8 @@
   #define mpxs_Apache__RequestRec_TIEHANDLE(stashsv, sv) \
   modperl_newSVsv_obj(aTHX_ stashsv, sv)
   
  -#define mpxs_Apache__RequestRec_PRINT mpxs_Apache__RequestRec_print
  +#define mpxs_Apache__RequestRec_PRINT  mpxs_Apache__RequestRec_print
  +#define mpxs_Apache__RequestRec_PRINTF mpxs_ap_rprintf
   
   #define mpxs_output_flush(r, rcfg) \
   /* if ($|) */ \
  @@ -55,6 +56,34 @@
   
   mpxs_output_flush(r, rcfg);
   
  +return bytes;
  +}  
  +
  +static MP_INLINE
  +apr_size_t mpxs_ap_rprintf(pTHX_ I32 items, SV **MARK, SV **SP)
  +{
  +modperl_config_req_t *rcfg;
  +request_rec *r;
  +apr_size_t bytes = 0;
  +SV *sv;
  +
  +mpxs_usage_va(2, r, $r-printf($fmt, ...));
  +
  +rcfg = modperl_config_req_get(r);
  +
  +/* XXX: we could have an rcfg-sprintf_buffer to reuse this SV
  + * across requests
  + */
  +sv = newSV(0);
  +modperl_perl_do_sprintf(aTHX_ sv, items, MARK);
  +bytes = SvCUR(sv);
  +
  +modperl_wbucket_write(rcfg-wbucket, SvPVX(sv), bytes);
  +
  +mpxs_output_flush(r, rcfg);
  +
  +SvREFCNT_dec(sv);
  +
   return bytes;
   }  
   
  
  
  
  1.35  +1 -1  modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- apache_functions.map  2001/10/22 02:46:55 1.34
  +++ apache_functions.map  2001/11/06 18:41:46 1.35
  @@ -92,7 +92,7 @@
ap_rflush
   PREFIX=ap_r
   ~ap_rwrite
  -~ap_rprintf
  + ap_rprintf | mpxs_ | ...
   !ap_rputc
   ~ap_rputs
ap_rvputs | mpxs_ | ... | puts
  
  
  
  1.26  +3 -2  modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- modperl_functions.map 2001/10/29 01:19:16 1.25
  +++ modperl_functions.map 2001/11/06 18:41:46 1.26
  @@ -25,8 +25,9 @@
mpxs_Apache_request | | classname, svr=Nullsv
   
   MODULE=Apache::RequestIO   PACKAGE=Apache::RequestRec
  - SV *:DEFINE_TIEHANDLE   | | SV *:stashsv, SV *:sv=Nullsv
  - apr_size_t:DEFINE_PRINT | | ...
  + SV *:DEFINE_TIEHANDLE| | SV *:stashsv, SV *:sv=Nullsv
  + apr_size_t:DEFINE_PRINT  | | ...
  + apr_size_t:DEFINE_PRINTF | | ...
mpxs_Apache__RequestRec_sendfile | | r, filename=r-filename, offset=0, len=0
mpxs_Apache__RequestRec_read | | r, buffer, bufsiz, offset=0
long:DEFINE_READ | | request_rec *:r, SV *:buffer, int:bufsiz, int:offset=0
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 10:41:59

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.43  +55 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- FunctionTable.pm  2001/11/06 18:26:13 1.42
  +++ FunctionTable.pm  2001/11/06 18:41:59 1.43
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Tue Nov  6 10:38:34 2001
  +# !  Tue Nov  6 10:53:09 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -2854,6 +2854,38 @@
 },
 {
   'return_type' = 'void',
  +'name' = 'modperl_perl_destruct',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'perl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_do_sprintf',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'SV *',
  +'name' = 'sv'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'len'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sarg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
   'name' = 'modperl_perl_exit',
   'args' = [
 {
  @@ -4536,6 +4568,28 @@
 {
   'type' = 'request_rec *',
   'name' = 'r'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_size_t',
  +'name' = 'mpxs_ap_rprintf',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'items'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'mark'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sp'
 }
   ]
 },
  
  
  



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

2001-11-06 Thread dougm

dougm   01/11/06 10:50:25

  Modified:t/modperl .cvsignore
  Added:   t/response/TestModperl print.pm
  Log:
  add tests for tied print/printf
  
  Revision  ChangesPath
  1.4   +1 -0  modperl-2.0/t/modperl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/modperl/.cvsignore,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- .cvsignore2001/11/06 18:43:57 1.3
  +++ .cvsignore2001/11/06 18:50:25 1.4
  @@ -1,3 +1,4 @@
   endav.t
   exit.t
   printf.t
  +print.t
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/print.pm
  
  Index: print.pm
  ===
  package TestModperl::print;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 3;
  
  ok 1;
  
  ok 2;
  
  printf ok %d, 3;
  
  Apache::OK;
  }
  
  1;
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 11:09:14

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  move ap_{setup,should}_client_block wrappers into
  modperl_{setup,should}_client_block so they can be called elsewhere
  
  Revision  ChangesPath
  1.19  +24 -9 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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Apache__RequestIO.h   2001/11/06 18:41:46 1.18
  +++ Apache__RequestIO.h   2001/11/06 19:09:14 1.19
  @@ -135,6 +135,27 @@
   return nrd;
   }
   
  +static MP_INLINE
  +apr_status_t modperl_setup_client_block(request_rec *r)
  +{
  +if (!r-read_length) {
  +apr_status_t rc;
  +
  +/* only do this once per-request */
  +if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  +ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
  + r-server,
  + mod_perl: ap_setup_client_block failed: %d, rc);
  +return rc;
  +}
  +}
  +
  +return APR_SUCCESS;
  +}
  +
  +#define modperl_should_client_block(r) \
  +(r-read_length || ap_should_client_block(r))
  +
   /* alias */
   #define mpxs_Apache__RequestRec_READ mpxs_Apache__RequestRec_read
   
  @@ -146,17 +167,11 @@
   long nrd = 0;
   int rc;
   
  -if (!r-read_length) {
  -/* only do this once per-request */
  -if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) {
  -ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0,
  - r-server,
  - mod_perl: ap_setup_client_block failed: %d, rc);
  -return 0;
  -}
  +if ((rc = modperl_setup_client_block(r)) != APR_SUCCESS) {
  +return 0;
   }
   
  -if (r-read_length || ap_should_client_block(r)) {
  +if (modperl_should_client_block(r)) {
   /* ap_should_client_block() will return 0 if r-read_length */
   mpxs_sv_grow(buffer, bufsiz+offset);
   nrd = ap_get_client_block(r, SvPVX(buffer)+offset, bufsiz);
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h

2001-11-06 Thread dougm

dougm   01/11/06 19:12:51

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  s/modperl_/mpxs_/ for {setup,should}_client_block wrappers
  
  Revision  ChangesPath
  1.20  +4 -4  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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Apache__RequestIO.h   2001/11/06 19:09:14 1.19
  +++ Apache__RequestIO.h   2001/11/07 03:12:50 1.20
  @@ -136,7 +136,7 @@
   }
   
   static MP_INLINE
  -apr_status_t modperl_setup_client_block(request_rec *r)
  +apr_status_t mpxs_setup_client_block(request_rec *r)
   {
   if (!r-read_length) {
   apr_status_t rc;
  @@ -153,7 +153,7 @@
   return APR_SUCCESS;
   }
   
  -#define modperl_should_client_block(r) \
  +#define mpxs_should_client_block(r) \
   (r-read_length || ap_should_client_block(r))
   
   /* alias */
  @@ -167,11 +167,11 @@
   long nrd = 0;
   int rc;
   
  -if ((rc = modperl_setup_client_block(r)) != APR_SUCCESS) {
  +if ((rc = mpxs_setup_client_block(r)) != APR_SUCCESS) {
   return 0;
   }
   
  -if (modperl_should_client_block(r)) {
  +if (mpxs_should_client_block(r)) {
   /* ap_should_client_block() will return 0 if r-read_length */
   mpxs_sv_grow(buffer, bufsiz+offset);
   nrd = ap_get_client_block(r, SvPVX(buffer)+offset, bufsiz);
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 19:13:21

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.44  +11 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- FunctionTable.pm  2001/11/06 18:41:59 1.43
  +++ FunctionTable.pm  2001/11/07 03:13:21 1.44
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Tue Nov  6 10:53:09 2001
  +# !  Tue Nov  6 19:24:25 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -5058,6 +5058,16 @@
 {
   'type' = 'apr_read_type_e',
   'name' = 'block'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_status_t',
  +'name' = 'mpxs_setup_client_block',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-11-06 Thread dougm

dougm   01/11/06 19:14:54

  Modified:lib/Apache ParseSource.pm
   lib/ModPerl TypeMap.pm WrapXS.pm
   src/modules/perl modperl_perl_includes.h
  Log:
  add logic so we can avoid dTHX; usage in modperl-only functions that have a pTHX_
  
  Revision  ChangesPath
  1.32  +7 -2  modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- ParseSource.pm2001/10/21 05:04:27 1.31
  +++ ParseSource.pm2001/11/07 03:14:54 1.32
  @@ -2,7 +2,7 @@
   
   use strict;
   use Apache::Build ();
  -use Config ();
  +use Config;
   
   our $VERSION = '0.02';
   
  @@ -60,7 +60,12 @@
   my $c = C::Scan-new(filename = $self-{scan_filename});
   
   $c-set(includeDirs = $self-includes);
  -$c-set(Defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN');
  +
  +my $defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN';
  +unless ($Config{useithreads} and $Config{useithreads} eq 'define') {
  +$defines .= ' -DMP_SOURCE_SCAN_NEED_ITHREADS';
  +}
  +$c-set(Defines = $defines);
   
   bless $c, 'Apache::ParseSource::Scan';
   }
  
  
  
  1.12  +18 -0 modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TypeMap.pm2001/10/07 19:22:49 1.11
  +++ TypeMap.pm2001/11/07 03:14:54 1.12
  @@ -194,12 +194,29 @@
   return [ map $self-map_arg($_), @$args ]
   }
   
  +#this is needed for modperl-only functions
  +#unlike apache/apr functions which are remapped to a mpxs_ function
  +sub thx_fixup {
  +my($self, $func) = @_;
  +
  +my $first = $func-{args}-[0];
  +
  +return unless $first;
  +
  +if ($first-{type} =~ /^PerlInterpreter/) {
  +shift @{ $func-{args} };
  +$func-{thx} = 1;
  +}
  +}
  +
   sub map_function {
   my($self, $func) = @_;
   
   my $map = $self-function_map-{ $func-{name} };
   return unless $map;
   
  +$self-thx_fixup($func);
  +
   return unless $self-can_map($map, $func-{return_type},
map $_-{type}, @{ $func-{args} });
   my $mf = {
  @@ -208,6 +225,7 @@
 $func-{return_type} || 'void'),
  args= $self-map_args($func),
  perl_name   = $map-{name},
  +   thx = $func-{thx},
   };
   
   for (qw(dispatch argspec orig_args prefix)) {
  
  
  
  1.34  +2 -2  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- WrapXS.pm 2001/10/22 17:20:11 1.33
  +++ WrapXS.pm 2001/11/07 03:14:54 1.34
  @@ -113,8 +113,8 @@
   $attrs
   EOF
   
  -if ($dispatch || $orig_args) {
  -my $thx = ;
  +if ($dispatch || $orig_args || $func-{thx}) {
  +my $thx = $func-{thx} ? 'aTHX_ ' : ;
   
   if ($dispatch) {
   $thx = 'aTHX_ ' if $dispatch =~ /^mpxs_/i;
  
  
  
  1.8   +5 -0  modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl_includes.h   2001/10/21 22:11:34 1.7
  +++ modperl_perl_includes.h   2001/11/07 03:14:54 1.8
  @@ -24,6 +24,11 @@
*/
   #   undef __attribute__
   #   define __attribute__(arg)
  +
  +#   ifdef MP_SOURCE_SCAN_NEED_ITHREADS
  +/* just need to have pTHX_ defined for proper prototypes */
  +#  define USE_ITHREADS
  +#   endif
   #endif
   
   #include EXTERN.h
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-06 Thread dougm

dougm   01/11/06 19:39:09

  Modified:xs/APR/Bucket APR__Bucket.h
   xs/APR/Table APR__Table.h
   xs/APR/URI APR__URI.h
   xs/Apache/Module Apache__Module.h
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/Apache/RequestUtil Apache__RequestUtil.h
   xs/Apache/ServerUtil Apache__ServerUtil.h
   xs/ModPerl/Global ModPerl__Global.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  rid dTHX; usage
  
  Revision  ChangesPath
  1.3   +1 -3  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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- APR__Bucket.h 2001/04/19 17:38:12 1.2
  +++ APR__Bucket.h 2001/11/07 03:39:08 1.3
  @@ -1,10 +1,8 @@
   #include modperl_bucket.h
   
  -static apr_bucket *mpxs_APR__Bucket_new(SV *classname, SV *sv,
  +static apr_bucket *mpxs_APR__Bucket_new(pTHX_ SV *classname, SV *sv,
   int offset, int len)
   {
  -dTHX; /*XXX*/
  -
   if (!len) {
   (void)SvPV(sv, len);
   }
  
  
  
  1.6   +3 -4  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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- APR__Table.h  2001/09/28 17:20:32 1.5
  +++ APR__Table.h  2001/11/07 03:39:08 1.6
  @@ -104,9 +104,8 @@
  ((apr_table_entry_t *) \
apr_table_elts(t)-elts)[mpxs_apr_table_iterix(sv)++].key
   
  -static MP_INLINE const char *mpxs_APR__Table_NEXTKEY(SV *tsv, SV *key)
  +static MP_INLINE const char *mpxs_APR__Table_NEXTKEY(pTHX_ SV *tsv, SV *key)
   {
  -dTHX;
   apr_table_t *t = mp_xs_sv2_APR__Table(tsv); 
   
   if (apr_is_empty_table(t)) {
  @@ -120,11 +119,11 @@
   return NULL;
   }
   
  -static MP_INLINE const char *mpxs_APR__Table_FIRSTKEY(SV *tsv)
  +static MP_INLINE const char *mpxs_APR__Table_FIRSTKEY(pTHX_ SV *tsv)
   {
   mpxs_apr_table_iterix(tsv) = 0; /* reset iterator index */
   
  -return mpxs_APR__Table_NEXTKEY(tsv, Nullsv);
  +return mpxs_APR__Table_NEXTKEY(aTHX_ tsv, Nullsv);
   }
   
   static XS(MPXS_apr_table_get)
  
  
  
  1.3   +1 -2  modperl-2.0/xs/APR/URI/APR__URI.h
  
  Index: APR__URI.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/URI/APR__URI.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- APR__URI.h2001/08/19 17:33:32 1.2
  +++ APR__URI.h2001/11/07 03:39:08 1.3
  @@ -36,9 +36,8 @@
   }
   
   static MP_INLINE
  -char *mpxs_APR__URI_port(apr_uri_t *uri, SV *portsv)
  +char *mpxs_APR__URI_port(pTHX_ apr_uri_t *uri, SV *portsv)
   {
  -dTHX; /*XXX*/
   char *port_str = uri-port_str;
   
   if (portsv) {
  
  
  
  1.4   +1 -2  modperl-2.0/xs/Apache/Module/Apache__Module.h
  
  Index: Apache__Module.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Module/Apache__Module.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Apache__Module.h  2001/10/06 01:03:27 1.3
  +++ Apache__Module.h  2001/11/07 03:39:08 1.4
  @@ -1,7 +1,7 @@
   #define mpxs_Apache__Module_top_module(CLASS) \
   (CLASS ? ap_top_module : ap_top_module)
   
  -static MP_INLINE int mpxs_Apache__Module_loaded(char *name)
  +static MP_INLINE int mpxs_Apache__Module_loaded(pTHX_ char *name)
   {
   char nameptr[256];
   char *base;
  @@ -34,7 +34,6 @@
   return 0;
   }
   else {
  -dTHX; /*XXX*/ 
   return modperl_perl_module_loaded(aTHX_ name);
   }
   }
  
  
  
  1.21  +6 -6  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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Apache__RequestIO.h   2001/11/07 03:12:50 1.20
  +++ Apache__RequestIO.h   2001/11/07 03:39:08 1.21
  @@ -88,14 +88,14 @@
   }  
   
   /* alias */
  -#define mpxs_Apache__RequestRec_WRITE mpxs_Apache__RequestRec_write
  +#define mpxs_Apache__RequestRec_WRITE(r, buffer, bufsiz, offset) \
  +mpxs_Apache__RequestRec_write(aTHX_ r, buffer, bufsiz, offset)
   
   static MP_INLINE
  -apr_ssize_t mpxs_Apache__RequestRec_write(request_rec *r,
  +apr_ssize_t mpxs_Apache__RequestRec_write(pTHX_ request_rec *r,
 SV *buffer, apr_ssize_t bufsiz

cvs commit: modperl-2.0/t/filter/TestFilter input_body.pm

2001-11-05 Thread dougm

dougm   01/11/05 16:07:53

  Modified:t/filter/TestFilter input_body.pm
  Log:
  change filter logic to what is currently considered the right way
  
  Revision  ChangesPath
  1.7   +18 -10modperl-2.0/t/filter/TestFilter/input_body.pm
  
  Index: input_body.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_body.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- input_body.pm 2001/08/10 03:06:45 1.6
  +++ input_body.pm 2001/11/06 00:07:53 1.7
  @@ -15,28 +15,36 @@
   sub handler : FilterRequestHandler {
   my($filter, $bb, $mode, $readbytes) = @_;
   
  -if ($bb-empty) {
  -my $rv = $filter-next-get_brigade($bb, $mode, $readbytes);
  +my $ctx_bb = APR::Brigade-new($filter-r-pool);
   
  -if ($rv != APR::SUCCESS) {
  -return $rv;
  -}
  +my $rv = $filter-next-get_brigade($ctx_bb, $mode, $readbytes);
  +
  +if ($rv != APR::SUCCESS) {
  +return $rv;
   }
   
  -while (!$bb-empty) {
  -my $bucket = $bb-first;
  +while (!$ctx_bb-empty) {
   my $data;
  -my $status = $bucket-read($data);
  +my $bucket = $ctx_bb-first;
   
   $bucket-remove;
   
  +if ($bucket-is_eos) {
  +$bb-insert_tail($bucket);
  +last;
  +}
  +
  +my $status = $bucket-read($data);
  +
  +if ($status != APR::SUCCESS) {
  +return $status;
  +}
  +
   if ($data) {
   $bucket = APR::Bucket-new(scalar reverse $data);
   }
   
   $bb-insert_tail($bucket);
  -
  -last if $bucket-is_eos;
   }
   
   Apache::OK;
  
  
  



cvs commit: modperl-2.0/t/filter input_body.t

2001-11-05 Thread dougm

dougm   01/11/05 16:08:10

  Modified:t/filter input_body.t
  Log:
  re-enable test
  
  Revision  ChangesPath
  1.3   +1 -1  modperl-2.0/t/filter/input_body.t
  
  Index: input_body.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/input_body.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- input_body.t  2001/10/05 23:51:26 1.2
  +++ input_body.t  2001/11/06 00:08:10 1.3
  @@ -5,7 +5,7 @@
   use Apache::TestRequest;
   
   #XXX: skip input_body filter test until filter changes dust settles
  -plan tests = 2, sub {0}; #\have_lwp;
  +plan tests = 2, \have_lwp;
   
   my $location = '/TestFilter::input_body';
   
  
  
  



cvs commit: modperl-2.0/t/filter/TestFilter input_msg.pm

2001-11-05 Thread dougm

dougm   01/11/05 16:08:46

  Modified:t/filter/TestFilter input_msg.pm
  Log:
  change filter logic to what is currently considered the right way
  
  Revision  ChangesPath
  1.7   +21 -11modperl-2.0/t/filter/TestFilter/input_msg.pm
  
  Index: input_msg.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_msg.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- input_msg.pm  2001/07/15 22:33:49 1.6
  +++ input_msg.pm  2001/11/06 00:08:46 1.7
  @@ -16,26 +16,36 @@
   sub handler : FilterConnectionHandler {
   my($filter, $bb, $mode, $readbytes) = @_;
   
  -if ($bb-empty) {
  -my $rv = $filter-next-get_brigade($bb, $mode, $readbytes);
  +my $ctx_bb = APR::Brigade-new($filter-c-pool);
   
  -if ($rv != APR::SUCCESS) {
  -return $rv;
  -}
  +my $rv = $filter-next-get_brigade($ctx_bb, $mode, $readbytes);
  +
  +if ($rv != APR::SUCCESS) {
  +return $rv;
   }
   
  -for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) {
  +while (!$ctx_bb-empty) {
   my $data;
  -my $status = $bucket-read($data);
  +my $bucket = $ctx_bb-first;
   
   $bucket-remove;
   
  -if ($data and $data =~ s,GET $from_url,GET $to_url,) {
  -$bb-insert_tail(APR::Bucket-new($data));
  -}
  -else {
  +if ($bucket-is_eos) {
   $bb-insert_tail($bucket);
  +last;
   }
  +
  +my $status = $bucket-read($data);
  +
  +if ($status != APR::SUCCESS) {
  +return $status;
  +}
  +
  +if ($data and $data =~ s,GET $from_url,GET $to_url,) {
  +$bucket = APR::Bucket-new($data);
  +}
  +
  +$bb-insert_tail($bucket);
   }
   
   Apache::OK;
  
  
  



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

2001-11-04 Thread dougm

dougm   01/11/04 20:50:57

  Modified:src/modules/perl modperl_util.c
  Log:
  check if @DynaLoader::dl_librefs actually has any elements
  in modperl_xs_dl_handles_get() before calling apr_array_make()
  
  Revision  ChangesPath
  1.28  +5 -0  modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- modperl_util.c2001/10/13 03:32:31 1.27
  +++ modperl_util.c2001/11/05 04:50:57 1.28
  @@ -276,6 +276,11 @@
return NULL;
   }
   
  +if (!AvFILL(librefs) = 0) {
  +/* dl_librefs and dl_modules are empty */
  +return NULL;
  +}
  +
   handles = apr_array_make(p, AvFILL(librefs)-1, sizeof(void *));
   
   for (i=0; i=AvFILL(librefs); i++) {
  
  
  



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

2001-11-04 Thread dougm

dougm   01/11/04 21:12:33

  Modified:src/modules/perl modperl_util.c
  Log:
  need some parens around AvFILL(librefs) = 0 check
  
  Revision  ChangesPath
  1.29  +1 -1  modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- modperl_util.c2001/11/05 04:50:57 1.28
  +++ modperl_util.c2001/11/05 05:12:33 1.29
  @@ -276,7 +276,7 @@
return NULL;
   }
   
  -if (!AvFILL(librefs) = 0) {
  +if (!(AvFILL(librefs) = 0)) {
   /* dl_librefs and dl_modules are empty */
   return NULL;
   }
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_callback.c modperl_config.c modperl_config.h modperl_interp.c modperl_types.h

2001-11-04 Thread dougm

dougm   01/11/04 21:19:01

  Modified:lib/ModPerl Code.pm
   src/modules/perl modperl_callback.c modperl_config.c
modperl_config.h modperl_interp.c modperl_types.h
  Log:
  add a per-request cleanup function that properly deals with PerlInterpScope
  
  Revision  ChangesPath
  1.71  +1 -1  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.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- Code.pm   2001/09/28 15:16:06 1.70
  +++ Code.pm   2001/11/05 05:19:01 1.71
  @@ -96,7 +96,7 @@
   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 SETUP_ENV)],
  +Req = [qw(NONE SET_GLOBAL_REQUEST SETUP_ENV CLEANUP_REGISTERED)],
   Interp = [qw(NONE IN_USE PUTBACK CLONED BASE)],
   Handler = [qw(NONE PARSED METHOD OBJECT ANON AUTOLOAD DYNAMIC)],
   );
  
  
  
  1.46  +8 -0  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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- modperl_callback.c2001/10/06 21:05:40 1.45
  +++ modperl_callback.c2001/11/05 05:19:01 1.46
  @@ -133,6 +133,14 @@
   }
   #endif
   
  +/* XXX: would like to do this in modperl_hook_create_request()
  + * but modperl_interp_select() is what figures out if
  + * PerlInterpScope eq handler, in which case we do not register
  + * a cleanup.  modperl_hook_create_request() is also currently always
  + * run even if modperl isn't handling any part of the request
  + */
  +modperl_config_req_cleanup_register(r, rcfg);
  +
   switch (type) {
 case MP_HANDLER_TYPE_PER_DIR:
 case MP_HANDLER_TYPE_PER_SRV:
  
  
  
  1.46  +22 -0 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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- modperl_config.c  2001/10/29 01:19:16 1.45
  +++ modperl_config.c  2001/11/05 05:19:01 1.46
  @@ -227,6 +227,28 @@
   return mrg;
   }
   
  +/* any per-request cleanup goes here */
  +
  +apr_status_t modperl_config_request_cleanup(pTHX_ request_rec *r)
  +{
  +MP_dRCFG;
  +
  +if (rcfg-pnotes) {
  +SvREFCNT_dec(rcfg-pnotes);
  +rcfg-pnotes = Nullhv;
  +}
  +
  +return APR_SUCCESS;
  +}
  +
  +apr_status_t modperl_config_req_cleanup(void *data)
  +{
  +request_rec *r = (request_rec *)data;
  +MP_dTHX;
  +
  +return modperl_config_request_cleanup(aTHX_ r);
  +}
  +
   void *modperl_get_perl_module_config(ap_conf_vector_t *cv)
   {
   return ap_get_module_config(cv, perl_module);
  
  
  
  1.30  +13 -0 modperl-2.0/src/modules/perl/modperl_config.h
  
  Index: modperl_config.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- modperl_config.h  2001/10/22 17:20:11 1.29
  +++ modperl_config.h  2001/11/05 05:19:01 1.30
  @@ -20,6 +20,19 @@
   #define modperl_config_srv_argv_push(arg) \
   *(const char **)apr_array_push(scfg-argv) = arg
   
  +apr_status_t modperl_config_request_cleanup(pTHX_ request_rec *r);
  +
  +apr_status_t modperl_config_req_cleanup(void *data);
  +
  +#define modperl_config_req_cleanup_register(r, rcfg) \
  +if (r  !MpReqCLEANUP_REGISTERED(rcfg)) { \
  +apr_pool_cleanup_register(r-pool, \
  +  (void*)r, \
  +   modperl_config_req_cleanup, \
  +   apr_pool_cleanup_null); \
  +MpReqCLEANUP_REGISTERED_On(rcfg); \
  +}
  +
   void *modperl_get_perl_module_config(ap_conf_vector_t *cv);
   void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg);
   
  
  
  
  1.38  +10 -0 modperl-2.0/src/modules/perl/modperl_interp.c
  
  Index: modperl_interp.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- modperl_interp.c  2001/11/01 23:50:32 1.37
  +++ modperl_interp.c  2001/11/05 05:19:01 1.38
  @@ -222,6 +222,14 @@
   modperl_interp_t *interp = (modperl_interp_t

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

2001-11-02 Thread dougm

dougm   01/11/02 09:23:54

  Modified:lib/Apache Build.pm
  Log:
  os cflags fixups need happen in perl_ccopts so generated Makefile.PLs get the changes
  
  Revision  ChangesPath
  1.71  +9 -7  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- Build.pm  2001/10/22 03:57:59 1.70
  +++ Build.pm  2001/11/02 17:23:54 1.71
  @@ -195,14 +195,21 @@
   }
   
   sub perl_ccopts {
  -shift-strip_lfs( $Config{ccflags} );
  +my $cflags = shift-strip_lfs( $Config{ccflags} );
  +
  +my $fixup = \{ccopts_$^O};
  +if (defined $fixup) {
  +$fixup-(\$cflags);
  +}
  +
  +$cflags;
   }
   
   sub ccopts_hpux {
   my $cflags = shift;
   #return if $Config{cc} eq 'gcc'; #XXX?
   return if $$cflags =~ /(-Ae|\+e)/;
  -$$cflags .=  -Ae;
  +$$cflags .=  -Ae ;
   }
   
   sub ccopts {
  @@ -210,11 +217,6 @@
   
   my $cflags = $self-perl_ccopts . ExtUtils::Embed::perl_inc() .
$self-ap_ccopts;
  -
  -my $fixup = \{ccopts_$^O};
  -if (defined $fixup) {
  -$fixup-(\$cflags);
  -}
   
   $cflags;
   }
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-11-02 Thread dougm

dougm   01/11/02 09:31:33

  Modified:.Makefile.PL
  Log:
  no need to check exists $build-{MP_USE_DSO}
  
  Revision  ChangesPath
  1.51  +1 -1  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Makefile.PL   2001/10/22 18:19:35 1.50
  +++ Makefile.PL   2001/11/02 17:31:33 1.51
  @@ -319,7 +319,7 @@
   my $self = shift;
   
   # install libmodperl.so
  -if (exists $build-{MP_USE_DSO}  $build-{MP_USE_DSO}) {
  +if ($build-{MP_USE_DSO}) {
   my $MODPERL_LIB = join '.', $build-{MP_LIBNAME}, 'so';
   $self-{PM}-{src/modules/perl/$MODPERL_LIB} =
   \$(APACHE_LIBDIR)/$MODPERL_LIB;
  
  
  



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

2001-11-02 Thread dougm

dougm   01/11/02 09:59:05

  Modified:.Makefile.PL
   lib/Apache Build.pm
  Log:
  change install method for libmodperl.so: now done via src/modules/perl/Makefile
  install target
  
  Revision  ChangesPath
  1.53  +10 -11modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Makefile.PL   2001/11/02 17:33:46 1.52
  +++ Makefile.PL   2001/11/02 17:59:05 1.53
  @@ -291,6 +291,9 @@
   modperl_lib:
cd $(MODPERL_SRC)  $(MAKE)
   
  +modperl_lib_install:
  + cd $(MODPERL_SRC)  $(MAKE) install
  +
   modperl_src_clean:
cd $(MODPERL_SRC)  $(MAKE) clean
   
  @@ -299,6 +302,13 @@
   $string;
   }
   
  +sub MY::install {
  +my $self = shift;
  +my $string = $self-MM::install(@_);
  +ModPerl::MM::add_dep(\$string, pure_install = 'modperl_lib_install');
  +$string;
  +}
  +
   sub MY::clean {
   my $self = shift;
   my $string = $self-MM::clean(@_);
  @@ -317,17 +327,6 @@
   
   sub MY::post_initialize {
   my $self = shift;
  -
  -#XXX: MakeMaker will try to unlink $(APACHE_LIBDIR)/$MODPERL_LIB
  -#during 'make' and probably 'make clean' as well
  -#need to find another way to install libmodperl.so
  -
  -# install libmodperl.so
  -#if ($build-{MP_USE_DSO}) {
  -#my $MODPERL_LIB = join '.', $build-{MP_LIBNAME}, 'so';
  -#$self-{PM}-{src/modules/perl/$MODPERL_LIB} =
  -#\$(APACHE_LIBDIR)/$MODPERL_LIB;
  -#}
   
   #up one from the Apache2/ subdir
   #so it can be found for 'use Apache2 ()'
  
  
  
  1.72  +10 -1 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- Build.pm  2001/11/02 17:23:54 1.71
  +++ Build.pm  2001/11/02 17:59:05 1.72
  @@ -738,7 +738,7 @@
   my $mm = bless {}, 'MM';
   $mm-init_others;
   
  -for (qw(rm_f mv ld ar)) {
  +for (qw(rm_f mv ld ar cp test_f)) {
   my $val = $mm-{\U$_};
   if ($val) {
   mm_replace(\$val);
  @@ -858,6 +858,11 @@
$self-{MODPERL_LIB_SHARED} :
$self-{MODPERL_LIB_STATIC});
   
  +for my $q (qw(LIBEXECDIR)) {
  +print $fh $self-canon_make_attr(AP_$q,
  + $self-apxs(-q = $q));
  +}
  +
   my $xs_targ = $self-make_xs($fh);
   
   print $fh 'EOF';
  @@ -872,6 +877,10 @@
   all: lib
   
   lib: $(MODPERL_LIB)
  +
  +install:
  + $(MODPERL_TEST_F) $(MODPERL_LIB_SHARED)  \
  + $(MODPERL_CP) $(MODPERL_LIB_SHARED) $(MODPERL_AP_LIBEXECDIR)
   
   .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s
   
  
  
  



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

2001-11-01 Thread dougm

dougm   01/11/01 18:59:32

  Modified:src/modules/perl modperl_perl.c
  Log:
  prevent perl from free-ing the environ array multiple times (segv)
  
  Revision  ChangesPath
  1.8   +9 -0  modperl-2.0/src/modules/perl/modperl_perl.c
  
  Index: modperl_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl.c2001/11/01 23:50:32 1.7
  +++ modperl_perl.c2001/11/02 02:59:32 1.8
  @@ -91,6 +91,15 @@
   
   PL_perl_destruct_level = 2;
   
  +#ifdef USE_ENVIRON_ARRAY
  +/* XXX: otherwise Perl may try to free() environ multiple times
  + * but it wasn't Perl that modified environ
  + * at least, not if modperl is doing things right
  + * this is a bug in Perl.
  + */
  +PL_origenviron = environ;
  +#endif
  +
   perl_destruct(perl);
   
   /* XXX: big bug in 5.6.1 fixed in 5.7.2+
  
  
  



cvs commit: modperl-2.0/xs/Apache/RequestUtil Apache__RequestUtil.h

2001-11-01 Thread dougm

dougm   01/11/01 14:18:25

  Modified:xs/Apache/RequestUtil Apache__RequestUtil.h
  Log:
  change mpxs_Apache__RequestRec_location to return char * rather than SV *
  and do not need the if (r-per_dir_config) check
  
  Revision  ChangesPath
  1.9   +3 -12 modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h
  
  Index: Apache__RequestUtil.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Apache__RequestUtil.h 2001/10/29 01:19:16 1.8
  +++ Apache__RequestUtil.h 2001/11/01 22:18:25 1.9
  @@ -181,18 +181,9 @@
   modperl_dir_config(aTHX_ r, r-server, key, sv_val)
   
   static MP_INLINE
  -SV *mpxs_Apache__RequestRec_location(request_rec *r)
  +char *mpxs_Apache__RequestRec_location(request_rec *r)
   {
  -dTHX; /* XXX */
  +MP_dDCFG;
   
  -if (r-per_dir_config) {
  -MP_dDCFG;
  -char *location;
  -
  -if ((location = dcfg-location)) {
  -return newSVpv(location, 0); 
  -}
  -}
  -
  -return PL_sv_undef;
  +return dcfg-location;
   }
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-11-01 Thread dougm

dougm   01/11/01 14:19:49

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  add missing table entry for $r-location
  
  Revision  ChangesPath
  1.41  +11 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- FunctionTable.pm  2001/10/22 17:25:39 1.40
  +++ FunctionTable.pm  2001/11/01 22:19:49 1.41
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Oct 22 10:35:51 2001
  +# !  Thu Nov  1 14:22:34 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -4043,6 +4043,16 @@
 {
   'type' = 'const char *',
   'name' = 'name'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'char *',
  +'name' = 'mpxs_Apache__RequestRec_location',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_interp.c modperl_perl.c modperl_perl.h

2001-11-01 Thread dougm

dougm   01/11/01 15:50:32

  Modified:src/modules/perl mod_perl.c modperl_interp.c modperl_perl.c
modperl_perl.h
  Log:
  moving perl_destruct() and releated items into modperl_perl_destruct() wrapper
  
  Revision  ChangesPath
  1.93  +1 -3  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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- mod_perl.c2001/10/13 19:11:32 1.92
  +++ mod_perl.c2001/11/01 23:50:32 1.93
  @@ -9,12 +9,10 @@
   
   handles = modperl_xs_dl_handles_get(aTHX_ cdata-pool);
   
  -PL_perl_destruct_level = 2;
   MP_TRACE_i(MP_FUNC, destroying interpreter=0x%lx\n,
  (unsigned long)perl);
   
  -perl_destruct(perl);
  -perl_free(perl);
  +modperl_perl_destruct(perl);
   
   if (handles) {
   modperl_xs_dl_handles_close(cdata-pool, handles);
  
  
  
  1.37  +1 -12 modperl-2.0/src/modules/perl/modperl_interp.c
  
  Index: modperl_interp.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- modperl_interp.c  2001/10/21 22:10:11 1.36
  +++ modperl_interp.c  2001/11/01 23:50:32 1.37
  @@ -83,9 +83,6 @@
   MP_TRACE_i(MP_FUNC, *error - still in use!*\n);
   }
   
  -PERL_SET_CONTEXT(interp-perl);
  -PL_perl_destruct_level = 2;
  -
   /* we cant use interp-mip-ap_pool without locking
* apr_pool_create() will mutex lock for us
* XXX: could roll something without using apr_pool_t
  @@ -93,16 +90,8 @@
*/
   (void)apr_pool_create(p, NULL);
   handles = modperl_xs_dl_handles_get(aTHX_ p);
  -
  -perl_destruct(interp-perl);
   
  -/* XXX: big bug in 5.6.1 fixed in 5.7.2+
  - * XXX: see CLONEf_CLONE_HOST perl_clone() flag
  - * XXX: try to find a workaround for 5.6.1
  - */
  -#ifndef WIN32
  -perl_free(interp-perl);
  -#endif
  +modperl_perl_destruct(interp-perl);
   
   if (handles) {
   modperl_xs_dl_handles_close(p, handles);
  
  
  
  1.7   +19 -0 modperl-2.0/src/modules/perl/modperl_perl.c
  
  Index: modperl_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_perl.c2001/10/21 05:46:47 1.6
  +++ modperl_perl.c2001/11/01 23:50:32 1.7
  @@ -82,3 +82,22 @@
   modperl_perl_init_ids(aTHX_ ids);
   #endif
   }
  +
  +void modperl_perl_destruct(PerlInterpreter *perl)
  +{
  +dTHXa(perl);
  +
  +PERL_SET_CONTEXT(perl);
  +
  +PL_perl_destruct_level = 2;
  +
  +perl_destruct(perl);
  +
  +/* XXX: big bug in 5.6.1 fixed in 5.7.2+
  + * XXX: see CLONEf_CLONE_HOST perl_clone() flag
  + * XXX: try to find a workaround for 5.6.1
  + */
  +#ifndef WIN32
  +perl_free(perl);
  +#endif
  +}
  
  
  
  1.7   +2 -0  modperl-2.0/src/modules/perl/modperl_perl.h
  
  Index: modperl_perl.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_perl.h2001/10/21 05:46:47 1.6
  +++ modperl_perl.h2001/11/01 23:50:32 1.7
  @@ -11,4 +11,6 @@
   
   void modperl_perl_init_ids_server(server_rec *s);
   
  +void modperl_perl_destruct(PerlInterpreter *perl);
  +
   #endif /* MODPERL_PERL_H */
  
  
  



cvs commit: modperl-2.0/xs/maps modperl_functions.map

2001-10-28 Thread stas

stas01/10/28 17:19:16

  Modified:src/modules/perl modperl_config.c
   t/response/TestAPI request_rec.pm
   todo api.txt
   xs/Apache/RequestUtil Apache__RequestUtil.h
   xs/maps  modperl_functions.map
  Log:
  - implement $r-location
  
  Revision  ChangesPath
  1.45  +4 -0  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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- modperl_config.c  2001/10/22 17:20:11 1.44
  +++ modperl_config.c  2001/10/29 01:19:16 1.45
  @@ -4,6 +4,8 @@
   {
   modperl_config_dir_t *dcfg = modperl_config_dir_new(p);
   
  +dcfg-location = dir;
  +
   #ifdef USE_ITHREADS
   /* defaults to per-server scope */
   dcfg-interp_scope = MP_INTERP_SCOPE_UNDEF;
  @@ -60,6 +62,8 @@
   
   mrg-flags = modperl_options_merge(p, base-flags, add-flags);
   
  +merge_item(location);
  +
   merge_table_overlap_item(SetVar);
   
   /* XXX: check if Perl*Handler is disabled */
  
  
  
  1.9   +5 -1  modperl-2.0/t/response/TestAPI/request_rec.pm
  
  Index: request_rec.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- request_rec.pm2001/09/28 20:11:02 1.8
  +++ request_rec.pm2001/10/29 01:19:16 1.9
  @@ -11,7 +11,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 48;
  +plan $r, tests = 49;
   
   #Apache-request($r); #PerlOptions +GlobalRequest takes care
   my $gr = Apache-request;
  @@ -181,6 +181,10 @@
   ok $r-uri;
   
   ok $r-filename;
  +
  +ok t_cmp('/' . __PACKAGE__,
  + $r-location,
  + location);
   
   my $mtime = (stat __FILE__)[9];
   $r-mtime($mtime);
  
  
  
  1.12  +0 -3  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- api.txt   2001/10/09 00:14:10 1.11
  +++ api.txt   2001/10/29 01:19:16 1.12
  @@ -85,9 +85,6 @@
   Apache-httpd_conf:
   depends on Perl sections
   
  -$r-location:
  -not yet implemented
  -
   Apache-request:
   need to deal with subclass objects which are not a request_rec
   (e.g. HASH ref)
  
  
  
  1.8   +17 -0 modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h
  
  Index: Apache__RequestUtil.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Apache__RequestUtil.h 2001/09/28 20:11:02 1.7
  +++ Apache__RequestUtil.h 2001/10/29 01:19:16 1.8
  @@ -179,3 +179,20 @@
   
   #define mpxs_Apache__RequestRec_dir_config(r, key, sv_val) \
   modperl_dir_config(aTHX_ r, r-server, key, sv_val)
  +
  +static MP_INLINE
  +SV *mpxs_Apache__RequestRec_location(request_rec *r)
  +{
  +dTHX; /* XXX */
  +
  +if (r-per_dir_config) {
  +MP_dDCFG;
  +char *location;
  +
  +if ((location = dcfg-location)) {
  +return newSVpv(location, 0); 
  +}
  +}
  +
  +return PL_sv_undef;
  +}
  
  
  
  1.25  +1 -0  modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_functions.map 2001/10/09 18:01:21 1.24
  +++ modperl_functions.map 2001/10/29 01:19:16 1.25
  @@ -12,6 +12,7 @@
mpxs_Apache__RequestRec_push_handlers
mpxs_Apache__RequestRec_set_handlers
mpxs_Apache__RequestRec_get_handlers
  + mpxs_Apache__RequestRec_location
   
#protocol module helpers
mpxs_Apache__RequestRec_location_merge
  
  
  



cvs commit: modperl-2.0/xs/tables/current/Apache FunctionTable.pm StructureTable.pm

2001-10-27 Thread dougm

dougm   01/10/27 09:54:21

  Modified:xs/tables/current/Apache FunctionTable.pm StructureTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.23  +19 -3 modperl-2.0/xs/tables/current/Apache/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- FunctionTable.pm  2001/10/21 04:54:25 1.22
  +++ FunctionTable.pm  2001/10/27 16:54:20 1.23
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Sat Oct 20 22:03:27 2001
  +# !  Sat Oct 27 10:00:40 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -3337,6 +3337,10 @@
   'name' = 'pid'
 },
 {
  +'type' = 'apr_exit_why_e',
  +'name' = 'why'
  +  },
  +  {
   'type' = 'int',
   'name' = 'status'
 }
  @@ -4904,10 +4908,14 @@
   'name' = 'ap_wait_or_timeout',
   'args' = [
 {
  -'type' = 'int *',
  +'type' = 'apr_exit_why_e *',
   'name' = 'status'
 },
 {
  +'type' = 'int *',
  +'name' = 'exitcode'
  +  },
  +  {
   'type' = 'apr_proc_t *',
   'name' = 'ret'
 },
  @@ -9244,6 +9252,10 @@
   'name' = 'exitcode'
 },
 {
  +'type' = 'apr_exit_why_e *',
  +'name' = 'exitwhy'
  +  },
  +  {
   'type' = 'apr_wait_how_e',
   'name' = 'waithow'
 }
  @@ -9259,7 +9271,11 @@
 },
 {
   'type' = 'int *',
  -'name' = 'status'
  +'name' = 'exitcode'
  +  },
  +  {
  +'type' = 'apr_exit_why_e *',
  +'name' = 'exitwhy'
 },
 {
   'type' = 'apr_wait_how_e',
  
  
  
  1.22  +5 -1  modperl-2.0/xs/tables/current/Apache/StructureTable.pm
  
  Index: StructureTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/StructureTable.pm,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- StructureTable.pm 2001/10/21 04:54:25 1.21
  +++ StructureTable.pm 2001/10/27 16:54:20 1.22
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Sat Oct 20 22:03:29 2001
  +# !  Sat Oct 27 10:00:46 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -1266,6 +1266,10 @@
 },
 {
   'type' = 'apr_dso_handle_t',
  +'elts' = []
  +  },
  +  {
  +'type' = 'apr_exit_why_e',
   'elts' = []
 },
 {
  
  
  



cvs commit: modperl-2.0/xs modperl_xs_util.h

2001-10-27 Thread dougm

dougm   01/10/27 10:14:17

  Modified:src/modules/perl modperl_util.h
   xs   modperl_xs_util.h
  Log:
  moving macros to be available outside .xs:
  mpxs_sv_grow= MP_SvGROW
  mpxs_sv_cur_set = MP_SvCUR_set
  
  Revision  ChangesPath
  1.29  +9 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- modperl_util.h2001/10/21 06:22:45 1.28
  +++ modperl_util.h2001/10/27 17:14:17 1.29
  @@ -34,6 +34,15 @@
   #define SvObjIV(o) SvIV((SV*)SvRV(o))
   #define MgObjIV(m) SvIV((SV*)SvRV(m-mg_obj))
   
  +#define MP_SvGROW(sv, len) \
  +(void)SvUPGRADE(sv, SVt_PV); \
  +SvGROW(sv, len+1)
  +
  +#define MP_SvCUR_set(sv, len) \
  +SvCUR_set(sv, len); \
  +*SvEND(sv) = '\0'; \
  +SvPOK_only(sv)
  +
   #define MP_magical_untie(sv, mg_flags) \
   mg_flags = SvMAGICAL((SV*)sv); \
   SvMAGICAL_off((SV*)sv)
  
  
  
  1.10  +4 -7  modperl-2.0/xs/modperl_xs_util.h
  
  Index: modperl_xs_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- modperl_xs_util.h 2001/09/25 19:44:03 1.9
  +++ modperl_xs_util.h 2001/10/27 17:14:17 1.10
  @@ -33,14 +33,11 @@
   #define XPUSHs_mortal_iv(iv) EXTEND(SP, 1); PUSHs_mortal_iv(iv)
   #define XPUSHs_mortal_pv(pv) EXTEND(SP, 1); PUSHs_mortal_pv(pv)
   
  -#define mpxs_sv_grow(sv, len) \
  -(void)SvUPGRADE(sv, SVt_PV); \
  -SvGROW(sv, len+1)
  +/* XXX: replace the old mpxs_sv_ macros with MP_Sv macros */
   
  -#define mpxs_sv_cur_set(sv, len) \
  -SvCUR_set(sv, len); \
  -*SvEND(sv) = '\0'; \
  -SvPOK_only(sv)
  +#define mpxs_sv_grow(sv, len)MP_SvGROW(sv, len)
  +
  +#define mpxs_sv_cur_set(sv, len) MP_SvCUR_set(sv, len)
   
   #define mpxs_set_targ(func, arg) \
   STMT_START { \
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry TODO

2001-10-22 Thread stas

stas01/10/22 01:33:48

  Modified:ModPerl-Registry TODO
  Log:
  - document the rest of the nice to have things
  
  Revision  ChangesPath
  1.4   +39 -7 modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TODO  2001/10/22 05:18:23 1.3
  +++ TODO  2001/10/22 08:33:48 1.4
  @@ -7,8 +7,6 @@
   - consider not to use $$ in debug tracing. Not all platforms give out
 a different pid for different threads.
   
  -
  -
   ### missing features ###
   
   - need to port $Apache::__T, to test against when user supplies -T flag.
  @@ -40,20 +38,54 @@
 normally. select() helps, but STDERR should be unbuffered in first
 place.
   
  +- in namespace_from_filename() should test whether a file is a symlink
  +  and if so use readlink() to get the real filename.
  +
   ### optimizations ###
   
   - $o-[CLASS] of the subclass is known at compile time, so should
 create the subs using $o-[CLASS] on the fly for each subclass
 which wants them
   
  -### nice to have ###
  +- currently the default is to strip __DATA__|__END__ and everything
  +  after that, which incurs a little overhead because of the s/// on
  +  the contents of the file. This feature wasn't in 1.x, so may
  +  consider to make it optional.
   
  -- in namespace_from_filename() should test whether a file is a symlink
  -  and if so use readlink() to get the real filename.
  -
  -### other things ###
  +### nice to have ###
   
   - Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
 http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
 Message-ID: [EMAIL PROTECTED]
   
  +- the closure issue:
  +  there was a suggestion from raptor to use goto() to leave the code
  +  unwrapped in the sub handler, which will solve the closure problem,
  +  but the problem is that once you leave a subroutine with goto() you
  +  cannot return, because you aren't in the sub anymore.
  +
  +  barrie has suggested a different approach, which requires adding
  +  special tags to the script which help to parse the code, and shuffle
  +  things around without putting subs inside the 'sub handler', but
  +  this requires a lot of code understanding from a user, and if its
  +  gained it's probably easier to fix the script so closure effect
  +  won't happen. However barrie's suggestion can be easily added, by
  +  overriding convert_script_to_compiled_handler().
  +
  +- global variables persistance: could have the cooker option to flush
  +  globals in the autogenerated package at the end of each
  +  request. (not packages use()'d from this package)
  +
  +- could also try to privide an optional workaround for the problem
  +  with libs collisions as explained here:
  +  http://perl.apache.org/guide/porting.html#Name_collisions_with_Modules_and
  +
  +- It's a known kludge with mod_perl scripts coming from mod_cgi which
  +  use -M for file mtime comparisons, but are not aware of the fact
  +  that $^T is not getting reset on each request. So may be the cooker
  +  should have an option to reset $^T on each request.
  +
  +- develop a cooker() that cooks/modifies a registry package based on
  +  PerlSetVar variables. So for example a user can modify a behavior of
  +  an existing package (stat/donotstat...) and giving it a new name at
  +  the same time. Kinda flag-based inheritance.
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-22 Thread dougm

dougm   01/10/22 11:19:35

  Modified:.Makefile.PL
  Log:
  need touch dummy libmodperl.lib for win32 WrapXS/ Makefile.PLs
  
  Revision  ChangesPath
  1.50  +12 -0 modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- Makefile.PL   2001/10/22 04:51:14 1.49
  +++ Makefile.PL   2001/10/22 18:19:35 1.50
  @@ -56,6 +56,18 @@
   post_configure();
   
   sub configure {
  +if (Apache::Build::is_win32()) {
  +#Makefile.PL's in WrapXS/ just need to pass the -e libmodperl.lib test
  +#the real libmodperl.lib will be in place when WrapXS/ dll's are
  +#actually linked
  +my $lib = src/modules/perl/$build-{MP_LIBNAME}.lib;
  +unless (-e $lib) {
  +open my $fh, '', $lib or die open $lib: $!;
  +print $fh #this is a dummy file to trick MakeMaker;
  +close $fh;
  +}
  +}
  +
   system_sanity_check();
   set_modperl_version();
   
  
  
  



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

2001-10-22 Thread dougm

dougm   01/10/22 10:20:11

  Modified:lib/ModPerl WrapXS.pm
   src/modules/perl modperl_config.c modperl_config.h
  Log:
  wrap all references to perl_module inside macros that are redefined
  to call functions in .xs modules under WIN32 to avoid referencing perl_module
  outside of libmodperl.so
  
  Revision  ChangesPath
  1.33  +3 -2  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- WrapXS.pm 2001/10/22 02:43:18 1.32
  +++ WrapXS.pm 2001/10/22 17:20:11 1.33
  @@ -410,7 +410,8 @@
   my($self, $module, $functions) = @_;
   
   my $fh = $self-open_class_file($module, '.xs');
  -print $fh $self-{noedit_warning_c}\n;
  +print $fh $self-{noedit_warning_c}\n,
  +  \n#define MP_IN_XS\n\n;
   
   my @includes = @{ $self-includes };
   
  @@ -652,7 +653,7 @@
   
   sub export_file_header_def {
   my $self = shift;
  -LIBRARY\n\nEXPORTS\n\nperl_module\n;
  +LIBRARY\n\nEXPORTS\n\n;
   }
   
   sub export_file_format_def {
  
  
  
  1.44  +10 -0 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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- modperl_config.c  2001/09/28 20:08:34 1.43
  +++ modperl_config.c  2001/10/22 17:20:11 1.44
  @@ -223,6 +223,16 @@
   return mrg;
   }
   
  +void *modperl_get_perl_module_config(ap_conf_vector_t *cv)
  +{
  +return ap_get_module_config(cv, perl_module);
  +}
  +
  +void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg)
  +{
  +ap_set_module_config(cv, perl_module, cfg);
  +}
  +
   int modperl_config_apply_PerlModule(server_rec *s,
   modperl_config_srv_t *scfg,
   PerlInterpreter *perl, apr_pool_t *p)
  
  
  
  1.29  +28 -11modperl-2.0/src/modules/perl/modperl_config.h
  
  Index: modperl_config.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- modperl_config.h  2001/10/11 15:38:23 1.28
  +++ modperl_config.h  2001/10/22 17:20:11 1.29
  @@ -20,33 +20,50 @@
   #define modperl_config_srv_argv_push(arg) \
   *(const char **)apr_array_push(scfg-argv) = arg
   
  +void *modperl_get_perl_module_config(ap_conf_vector_t *cv);
  +void modperl_set_perl_module_config(ap_conf_vector_t *cv, void *cfg);
  +
  +#if defined(MP_IN_XS)  defined(WIN32)
  +#   define modperl_get_module_config(v) \
  +   modperl_get_perl_module_config(v)
  +
  +#   define modperl_set_module_config(v, c) \
  +   modperl_set_perl_module_config(v, c)
  +#else
  +#   define modperl_get_module_config(v) \
  +   ap_get_module_config(v, perl_module)
  +
  +#   define modperl_set_module_config(v, c) \
  +   ap_set_module_config(v, perl_module, c)
  +#endif
  +
   #define modperl_config_req_init(r, rcfg) \
   if (!rcfg) { \
   rcfg = modperl_config_req_new(r); \
  -ap_set_module_config(r-request_config, perl_module, rcfg); \
  +modperl_set_module_config(r-request_config, rcfg); \
   }
   
   #define modperl_config_req_get(r) \
  - (r ? (modperl_config_req_t *) \
  -  ap_get_module_config(r-request_config, perl_module) : NULL)
  +(r ? (modperl_config_req_t *) \
  +  modperl_get_module_config(r-request_config) : NULL)
   
   #define MP_dRCFG \
  -   modperl_config_req_t *rcfg = modperl_config_req_get(r)
  +modperl_config_req_t *rcfg = modperl_config_req_get(r)
   
   #define modperl_config_dir_get(r) \
  -  (r ? (modperl_config_dir_t *) \
  -  ap_get_module_config(r-per_dir_config, perl_module) : NULL)
  +(r ? (modperl_config_dir_t *) \
  +  modperl_get_module_config(r-per_dir_config) : NULL)
   
   #define modperl_config_dir_get_defaults(s) \
  -  (modperl_config_dir_t *) \
  -  ap_get_module_config(s-lookup_defaults, perl_module)
  +(modperl_config_dir_t *) \
  +modperl_get_module_config(s-lookup_defaults)
   
   #define MP_dDCFG \
  -   modperl_config_dir_t *dcfg = modperl_config_dir_get(r)
  +modperl_config_dir_t *dcfg = modperl_config_dir_get(r)
   
   #define modperl_config_srv_get(s) \
  - (modperl_config_srv_t *) \
  -  ap_get_module_config(s-module_config, perl_module)
  +(modperl_config_srv_t *) \
  +modperl_get_module_config(s-module_config)
   
   #define MP_dSCFG(s) \
  modperl_config_srv_t *scfg = modperl_config_srv_get(s)
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-22 Thread dougm

dougm   01/10/22 10:25:39

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.40  +25 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- FunctionTable.pm  2001/10/21 06:51:07 1.39
  +++ FunctionTable.pm  2001/10/22 17:25:39 1.40
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Sun Oct 21 00:00:29 2001
  +# !  Mon Oct 22 10:35:51 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -1338,6 +1338,16 @@
 },
 {
   'return_type' = 'void *',
  +'name' = 'modperl_get_perl_module_config',
  +'args' = [
  +  {
  +'type' = 'ap_conf_vector_t *',
  +'name' = 'cv'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void *',
   'name' = 'modperl_global_get',
   'args' = [
 {
  @@ -3168,6 +3178,20 @@
 {
   'type' = 'apr_pool_t *',
   'name' = 'p'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_set_perl_module_config',
  +'args' = [
  +  {
  +'type' = 'ap_conf_vector_t *',
  +'name' = 'cv'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'cfg'
 }
   ]
 },
  
  
  



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

2001-10-22 Thread dougm

dougm   01/10/22 11:02:29

  Modified:t/hooks/TestHooks trans.pm
  Log:
  temp workaround for win32 problem with /TestFoo::bar urls
  
  Revision  ChangesPath
  1.3   +13 -1 modperl-2.0/t/hooks/TestHooks/trans.pm
  
  Index: trans.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/trans.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- trans.pm  2001/08/30 01:05:41 1.2
  +++ trans.pm  2001/10/22 18:02:29 1.3
  @@ -3,6 +3,8 @@
   use strict;
   use warnings FATAL = 'all';
   
  +use Apache::TestConfig ();
  +
   my %trans = (
   '/TestHooks/trans.pm' = sub {
   my $r = shift;
  @@ -19,8 +21,18 @@
   
   sub handler {
   my $r = shift;
  +
  +my $uri = $r-uri;
  +
  +#XXX: temp workaround, core_translate trips on :'s
  +if (Apache::TestConfig::WIN32()) {
  +if ($uri =~ m,^/Test[A-Z]\w+::,) {
  +$r-filename(__FILE__);
  +return Apache::OK;
  +}
  +}
   
  -my $handler = $trans{ $r-uri };
  +my $handler = $trans{ $uri };
   
   return Apache::DECLINED unless $handler;
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_interp.h

2001-10-21 Thread dougm

dougm   01/10/20 23:48:39

  Modified:src/modules/perl modperl_interp.h
  Log:
  remove prototypes of dead functions
  
  Revision  ChangesPath
  1.14  +0 -6  modperl-2.0/src/modules/perl/modperl_interp.h
  
  Index: modperl_interp.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- modperl_interp.h  2001/09/16 17:28:43 1.13
  +++ modperl_interp.h  2001/10/21 06:48:39 1.14
  @@ -33,12 +33,6 @@
   
   apr_status_t modperl_interp_pool_destroy(void *data);
   
  -void modperl_interp_pool_add(modperl_interp_pool_t *mip,
  - modperl_interp_t *interp);
  -
  -void modperl_interp_pool_remove(modperl_interp_pool_t *mip,
  -modperl_interp_t *interp);
  -
   typedef apr_status_t (*modperl_interp_mip_walker_t)(pTHX_ 
   modperl_interp_pool_t *mip,
   void *data);
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin special_blocks.pl

2001-10-21 Thread stas

stas01/10/20 23:53:28

  Modified:ModPerl-Registry/t special_blocks.t
  Added:   ModPerl-Registry/t/cgi-bin special_blocks.pl
  Log:
  - adding the forgotten file
  
  Revision  ChangesPath
  1.2   +2 -2  modperl-2.0/ModPerl-Registry/t/special_blocks.t
  
  Index: special_blocks.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/special_blocks.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- special_blocks.t  2001/10/19 07:36:13 1.1
  +++ special_blocks.t  2001/10/21 06:53:28 1.2
  @@ -22,7 +22,7 @@
   # PerlRun always run BEGIN/END since it's never cached
   
   my $alias = perlrun;
  -my $url = /same_interp/$alias/blocks.pl;
  +my $url = /same_interp/$alias/special_blocks.pl;
   my $same_interp = Apache::TestRequest::same_interp_tie($url);
   
   ok t_cmp(
  @@ -56,7 +56,7 @@
   
   
   for my $alias (grep !/^perlrun$/, @aliases) {
  -my $url = /same_interp/$alias/blocks.pl;
  +my $url = /same_interp/$alias/special_blocks.pl;
   my $same_interp = Apache::TestRequest::same_interp_tie($url);
   
   # clear the cache of the registry package for the script in $url
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl
  
  Index: special_blocks.pl
  ===
  #!perl -w
  
  # test BEGIN/END blocks
  
  use ModPerl::RegistryCooker ();
  
  use vars qw($query);
  $query = '' unless defined $query;
  
  BEGIN {
  $query = $ENV{QUERY_STRING};
  }
  
  print Content-type: text/plain\r\n\r\n;
  
  my $r = shift;
  my %args = $r-Apache::args;
  our $test = exists $args{test} ? $args{test} : '';
  
  if ($test eq 'uncache') {
  # mark the script as non-cached for the next execution
  require ModPerl::RegistryCooker;
  ModPerl::RegistryCooker::uncache_myself();
  }
  elsif ($test eq 'begin') {
  print begin ok if $query eq 'test=begin';
  # reset the global
  $query = '';
  }
  
  END {
  if ($test eq 'end') {
  print end ok;
  }
  }
  
  
  
  



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

2001-10-21 Thread dougm

dougm   01/10/20 23:57:07

  Modified:lib/Apache Build.pm
  Log:
  include -def:modperl_ithreads.def for win32
  
  Revision  ChangesPath
  1.63  +1 -1  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- Build.pm  2001/10/21 06:43:34 1.62
  +++ Build.pm  2001/10/21 06:57:07 1.63
  @@ -765,7 +765,7 @@
   sub dynamic_link_MSWin32 {
   my $self = shift;
   my @defs = map -def:$self-{cwd}/xs/modperl$_.def,
  -(, _inline);
  +(, _inline, _ithreads);
   return $self-dynamic_link_header_default .
  @defs . 'EOF';
-out:$@
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_filter.c modperl_handler.c modperl_log.c modperl_perl_includes.h

2001-10-21 Thread dougm

dougm   01/10/21 15:11:34

  Modified:src/modules/perl modperl_filter.c modperl_handler.c
modperl_log.c modperl_perl_includes.h
  Log:
  tweaks so we could compile without -DPERL_CORE on win32
  
  Revision  ChangesPath
  1.28  +2 -1  modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- modperl_filter.c  2001/10/14 17:18:10 1.27
  +++ modperl_filter.c  2001/10/21 22:11:34 1.28
  @@ -556,7 +556,7 @@
   {
   apr_bucket *bucket;
   int i = 0;
  -
  +#ifndef WIN32
   if (fp == NULL) {
   fp = stderr;
   }
  @@ -572,4 +572,5 @@
   (unsigned long)bucket-data);
   i++;
   }
  +#endif
   }
  
  
  
  1.10  +2 -0  modperl-2.0/src/modules/perl/modperl_handler.c
  
  Index: modperl_handler.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- modperl_handler.c 2001/04/19 17:57:15 1.9
  +++ modperl_handler.c 2001/10/21 22:11:34 1.10
  @@ -215,7 +215,9 @@
   
   if (!avp) {
   /* should never happen */
  +#if 0
   fprintf(stderr, PANIC: no such handler type: %d\n, type);
  +#endif
   return NULL;
   }
   
  
  
  
  1.5   +4 -0  modperl-2.0/src/modules/perl/modperl_log.c
  
  Index: modperl_log.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_log.c 2000/06/20 16:04:40 1.4
  +++ modperl_log.c 2001/10/21 22:11:34 1.5
  @@ -1,9 +1,12 @@
   #include mod_perl.h
   
  +#undef getenv /* from XSUB.h */
  +
   U32 MP_debug_level = 0;
   
   void modperl_trace(char *func, const char *fmt, ...)
   {
  +#ifndef WIN32 /* XXX */
   va_list args;
   
   if (func) {
  @@ -13,6 +16,7 @@
   va_start(args, fmt);
   vfprintf(stderr, fmt, args);
   va_end(args);
  +#endif
   }
   
   void modperl_trace_level_set(const char *level)
  
  
  
  1.7   +12 -0 modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_perl_includes.h   2001/09/25 19:44:02 1.6
  +++ modperl_perl_includes.h   2001/10/21 22:11:34 1.7
  @@ -38,6 +38,18 @@
   
   /* avoiding namespace collisions */
   
  +/* from XSUB.h */
  +/* mod_perl.c calls exit() in a few places */
  +#undef exit
  +/* modperl_tipool.c references abort() */
  +#undef abort
  +/* these three clash with apr bucket structure member names */
  +#undef link
  +#undef read
  +#undef free
  +/* modperl_perl.c */
  +#undef getpid
  +
   #ifdef list
   #   undef list
   #endif
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-21 Thread dougm

dougm   01/10/21 16:07:01

  Modified:.Makefile.PL
  Log:
  always using .so extension for libmodperl
  
  Revision  ChangesPath
  1.48  +2 -2  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Makefile.PL   2001/10/21 06:43:34 1.47
  +++ Makefile.PL   2001/10/21 23:07:01 1.48
  @@ -299,9 +299,9 @@
   sub MY::post_initialize {
   my $self = shift;
   
  -# install libmodperl.so, MODPERL_LIB is not known here yet
  +# install libmodperl.so
   if (exists $build-{MP_USE_DSO}  $build-{MP_USE_DSO}) {
  -my $MODPERL_LIB = join '.', $build-{MP_LIBNAME}, $Config{dlext};
  +my $MODPERL_LIB = join '.', $build-{MP_LIBNAME}, 'so';
   $self-{PM}-{src/modules/perl/$MODPERL_LIB} =
   \$(APACHE_LIBDIR)/$MODPERL_LIB;
   }
  
  
  



cvs commit: modperl-2.0/lib/ModPerl MM.pm

2001-10-21 Thread dougm

dougm   01/10/21 16:37:30

  Modified:lib/Apache Build.pm
   lib/ModPerl MM.pm
  Log:
  need to include $Config{ccflags} in CCFLAGS passed to MakeMaker
  
  Revision  ChangesPath
  1.64  +6 -2  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- Build.pm  2001/10/21 06:57:07 1.63
  +++ Build.pm  2001/10/21 23:37:30 1.64
  @@ -194,6 +194,10 @@
   $ccopts;
   }
   
  +sub perl_ccopts {
  +shift-strip_lfs( $Config{ccflags} );
  +}
  +
   sub ccopts_hpux {
   my $cflags = shift;
   #return if $Config{cc} eq 'gcc'; #XXX?
  @@ -204,8 +208,8 @@
   sub ccopts {
   my($self) = @_;
   
  -my $cflags = $self-strip_lfs(ExtUtils::Embed::ccopts()) .
  -  $self-ap_ccopts;
  +my $cflags = $self-perl_ccopts . ExtUtils::Embed::perl_inc() .
  + $self-ap_ccopts;
   
   my $fixup = \{ccopts_$^O};
   if (defined $fixup) {
  
  
  
  1.11  +2 -1  modperl-2.0/lib/ModPerl/MM.pm
  
  Index: MM.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MM.pm 2001/04/11 22:46:57 1.10
  +++ MM.pm 2001/10/21 23:37:30 1.11
  @@ -63,7 +63,8 @@
   }
   }
   
  -my @opts = (INC = $inc, CCFLAGS = $build-ap_ccopts);
  +my $ccflags = $build-perl_ccopts . $build-ap_ccopts;
  +my @opts = (INC = $inc, CCFLAGS = $ccflags);
   
   my @typemaps;
   my $pwd = Cwd::fastcwd();
  
  
  



cvs commit: modperl-2.0/lib/ModPerl MM.pm

2001-10-21 Thread dougm

dougm   01/10/21 16:43:42

  Modified:lib/ModPerl MM.pm
  Log:
  link apache libs against xs modules
  
  Revision  ChangesPath
  1.12  +7 -1  modperl-2.0/lib/ModPerl/MM.pm
  
  Index: MM.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MM.pm 2001/10/21 23:37:30 1.11
  +++ MM.pm 2001/10/21 23:43:42 1.12
  @@ -63,8 +63,14 @@
   }
   }
   
  +my $libs = $build-apache_libs;
   my $ccflags = $build-perl_ccopts . $build-ap_ccopts;
  -my @opts = (INC = $inc, CCFLAGS = $ccflags);
  +
  +my @opts = (
  +INC = $inc,
  +CCFLAGS = $ccflags,
  +LIBS= $libs,
  +);
   
   my @typemaps;
   my $pwd = Cwd::fastcwd();
  
  
  



cvs commit: modperl-2.0/lib/ModPerl MM.pm

2001-10-21 Thread dougm

dougm   01/10/21 17:10:13

  Modified:lib/Apache Build.pm
   lib/ModPerl MM.pm
  Log:
  add .def files to otherldflags for MakeMaker
  
  Revision  ChangesPath
  1.65  +20 -11modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- Build.pm  2001/10/21 23:37:30 1.64
  +++ Build.pm  2001/10/22 00:10:13 1.65
  @@ -748,6 +748,12 @@
   }
   }
   
  +sub export_files_MSWin32 {
  +my $self = shift;
  +map -def:$self-{cwd}/xs/modperl$_.def,
  +(, _inline, _ithreads);
  +}
  +
   sub dynamic_link_header_default {
   return 'EOF';
   $(MODPERL_LIBNAME).$(MODPERL_DLEXT): $(MODPERL_PIC_OBJS)
  @@ -768,8 +774,7 @@
   
   sub dynamic_link_MSWin32 {
   my $self = shift;
  -my @defs = map -def:$self-{cwd}/xs/modperl$_.def,
  -(, _inline, _ithreads);
  +my @defs = $self-export_files_MSWin32;
   return $self-dynamic_link_header_default .
  @defs . 'EOF';
-out:$@
  @@ -910,16 +915,20 @@
   
   sub otherldflags {
   my $self = shift;
  -my @ldflags = ();
  +my $flags = \{otherldflags_$^O};
  +return  unless defined $flags;
  +$flags-($self);
  +}
   
  -if ($^O eq 'aix') {
  -if (my $file = find_in_inc('mod_perl.exp')) {
  -push @ldflags, '-bI:' . $file;
  -}
  -my $httpdexp = $self-apxs('-q' = 'LIBEXECDIR') . '/httpd.exp';
  -push @ldflags, -bI:$httpdexp if -e $httpdexp;
  -}
  -return join(' ', @ldflags);
  +#XXX: install *.def / search @INC
  +sub otherldflags_MSWin32 {
  +my $self = shift;
  +my(@defs) = $self-export_files_MSWin32;
  +return @defs;
  +}
  +
  +sub otherldflags_aix {
  +; #XXX: -bI:*.exp files
   }
   
   sub typemaps {
  
  
  
  1.13  +1 -0  modperl-2.0/lib/ModPerl/MM.pm
  
  Index: MM.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MM.pm 2001/10/21 23:43:42 1.12
  +++ MM.pm 2001/10/22 00:10:13 1.13
  @@ -70,6 +70,7 @@
   INC = $inc,
   CCFLAGS = $ccflags,
   LIBS= $libs,
  +dynamic_lib = { OTHERLDFLAGS = $build-otherldflags },
   );
   
   my @typemaps;
  
  
  



cvs commit: modperl-2.0/lib/ModPerl MM.pm

2001-10-21 Thread dougm

dougm   01/10/21 18:38:06

  Modified:lib/Apache Build.pm
   lib/ModPerl MM.pm
  Log:
  win32 .xs -  .dll's need to link against libmodperl.lib
  
  Revision  ChangesPath
  1.68  +13 -0 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- Build.pm  2001/10/22 01:34:57 1.67
  +++ Build.pm  2001/10/22 01:38:06 1.68
  @@ -801,6 +801,19 @@
   $libs-($self);
   }
   
  +sub modperl_libs_MSWin32 {
  +my $self = shift;
  +#XXX: install/use libmodperl.lib for 3rd party xs modules
  +$self-{cwd}/src/modules/perl/libmodperl.lib;
  +}
  +
  +sub modperl_libs {
  +my $self = shift;
  +my $libs = \{modperl_libs_$^O};
  +return  unless defined $libs;
  +$libs-($self);
  +}
  +
   sub write_src_makefile {
   my $self = shift;
   my $code = ModPerl::Code-new;
  
  
  
  1.14  +1 -1  modperl-2.0/lib/ModPerl/MM.pm
  
  Index: MM.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MM.pm 2001/10/22 00:10:13 1.13
  +++ MM.pm 2001/10/22 01:38:06 1.14
  @@ -63,7 +63,7 @@
   }
   }
   
  -my $libs = $build-apache_libs;
  +my $libs = join ' ', $build-apache_libs, $build-modperl_libs;
   my $ccflags = $build-perl_ccopts . $build-ap_ccopts;
   
   my @opts = (
  
  
  



cvs commit: modperl-2.0/xs/ModPerl/Const Const.xs

2001-10-21 Thread dougm

dougm   01/10/21 20:41:38

  Modified:src/modules/perl modperl_const.h
   xs/APR/Const Const.xs
   xs/Apache/Const Const.xs
   xs/ModPerl/Const Const.xs
  Log:
  tweak {ModPerl,APR,Apache}::Const so XS_modperl_const_compile is not directly 
referenced outside ModPerl/Const.so
  
  Revision  ChangesPath
  1.2   +5 -0  modperl-2.0/src/modules/perl/modperl_const.h
  
  Index: modperl_const.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_const.h   2001/04/11 22:48:29 1.1
  +++ modperl_const.h   2001/10/22 03:41:37 1.2
  @@ -9,4 +9,9 @@
   
   XS(XS_modperl_const_compile);
   
  +#define MP_newModPerlConstXS(name) \
  +   newXS(name ::Const::compile, \
  + CvXSUB(get_cv(ModPerl::Const::compile, TRUE)), \
  + __FILE__)
  +
   #endif /* MODPERL_CONST_H */
  
  
  
  1.3   +2 -1  modperl-2.0/xs/APR/Const/Const.xs
  
  Index: Const.xs
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/Const/Const.xs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Const.xs  2001/06/17 03:39:19 1.2
  +++ Const.xs  2001/10/22 03:41:37 1.3
  @@ -6,4 +6,5 @@
   PROTOTYPES: disable
   
   BOOT:
  -newXS(APR::Const::compile, XS_modperl_const_compile, __FILE__);
  +MP_newModPerlConstXS(APR);
  +
  
  
  
  1.4   +1 -1  modperl-2.0/xs/Apache/Const/Const.xs
  
  Index: Const.xs
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Const/Const.xs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Const.xs  2001/06/16 19:14:09 1.3
  +++ Const.xs  2001/10/22 03:41:37 1.4
  @@ -6,4 +6,4 @@
   PROTOTYPES: disable
   
   BOOT:
  -newXS(Apache::Const::compile, XS_modperl_const_compile, __FILE__);
  +MP_newModPerlConstXS(Apache);
  
  
  
  1.4   +8 -0  modperl-2.0/xs/ModPerl/Const/Const.xs
  
  Index: Const.xs
  ===
  RCS file: /home/cvs/modperl-2.0/xs/ModPerl/Const/Const.xs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Const.xs  2001/06/16 19:14:08 1.3
  +++ Const.xs  2001/10/22 03:41:38 1.4
  @@ -1,6 +1,14 @@
   #include mod_perl.h
  +#include modperl_const.h
   
   MODULE = ModPerl::ConstPACKAGE = ModPerl::Const
   
   PROTOTYPES: disable
  +
  +BOOT:
  +#XXX:
  +#currently used just for {APR,Apache}/Const.{so,dll} to lookup
  +#XS_modperl_const_compile
  +#linking is fun.
  +newXS(ModPerl::Const::compile, XS_modperl_const_compile, __FILE__);
   
  
  
  



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

2001-10-21 Thread dougm

dougm   01/10/21 20:49:49

  Modified:lib/Apache Build.pm
  Log:
  cosmetic: add missing \t in win32 Makefile
  
  Revision  ChangesPath
  1.69  +1 -3  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Build.pm  2001/10/22 01:38:06 1.68
  +++ Build.pm  2001/10/22 03:49:49 1.69
  @@ -775,9 +775,7 @@
   my $self = shift;
   my $defs = $self-export_files_MSWin32;
   return $self-dynamic_link_header_default .
  -   $defs . 'EOF';
  - -out:$@
  -EOF
  +   \t$defs . ' -out:$@';
   }
   
   sub dynamic_link {
  
  
  



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

2001-10-21 Thread dougm

dougm   01/10/21 20:57:59

  Modified:lib/Apache Build.pm
  Log:
  clean win32 files (libmodperl.{lib,exp}
  
  Revision  ChangesPath
  1.70  +3 -1  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- Build.pm  2001/10/22 03:49:49 1.69
  +++ Build.pm  2001/10/22 03:57:59 1.70
  @@ -899,7 +899,9 @@
-c $*.c  $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
   
   clean:
  - $(MODPERL_RM_F) *.a *.so *.xsc *$(MODPERL_OBJ_EXT) *.lo *.i *.s \
  + $(MODPERL_RM_F) *.a *.so *.xsc \
  + $(MODPERL_LIBNAME).exp $(MODPERL_LIBNAME).lib \
  + *$(MODPERL_OBJ_EXT) *.lo *.i *.s \
$(MODPERL_CLEAN_FILES) \
$(MODPERL_XS_CLEAN_FILES)
   
  
  
  



cvs commit: modperl-2.0/t/conf .cvsignore

2001-10-21 Thread dougm

dougm   01/10/21 20:58:26

  Modified:src/modules/perl .cvsignore
   t/conf   .cvsignore
  Log:
  ignores
  
  Revision  ChangesPath
  1.9   +2 -0  modperl-2.0/src/modules/perl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/.cvsignore,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- .cvsignore2001/04/12 00:30:06 1.8
  +++ .cvsignore2001/10/22 03:58:26 1.9
  @@ -13,6 +13,8 @@
   *.a
   *.so
   *.i
  +*.exp
  +*.lib
   TAGS
   modperl_constants.h
   modperl_constants.c
  
  
  
  1.3   +1 -0  modperl-2.0/t/conf/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/conf/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore2001/09/12 17:11:48 1.2
  +++ .cvsignore2001/10/22 03:58:26 1.3
  @@ -1,5 +1,6 @@
   httpd.conf
   extra.conf
  +mime.types
   modperl_inc.pl
   modperl_startup.pl
   apache_test_config.pm
  
  
  



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

2001-10-21 Thread dougm

dougm   01/10/21 22:42:23

  Modified:src/modules/perl modperl_const.c
  Log:
  XSRETURN_YES in ModPerl::Const::import makes win32 blowup; XSRETURN_EMPTY is ok
  
  Revision  ChangesPath
  1.8   +1 -1  modperl-2.0/src/modules/perl/modperl_const.c
  
  Index: modperl_const.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_const.c   2001/05/04 03:44:23 1.7
  +++ modperl_const.c   2001/10/22 05:42:23 1.8
  @@ -106,5 +106,5 @@
   (void)modperl_const_compile(aTHX_ classname, arg, SvPV(ST(i), n_a));
   }
   
  -XSRETURN_YES;
  +XSRETURN_EMPTY;
   }
  
  
  



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

2001-10-20 Thread dougm

dougm   01/10/20 22:24:52

  Modified:lib/Apache Build.pm
  Log:
  avoid use of unintialized value
  
  Revision  ChangesPath
  1.60  +12 -2 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Build.pm  2001/10/21 04:47:47 1.59
  +++ Build.pm  2001/10/21 05:24:52 1.60
  @@ -707,6 +707,11 @@
 (qw(cc cpprun rm ranlib lib_ext obj_ext cccdlflags lddlflags),
  values %perl_config_pm_alias);
   
  +sub mm_replace {
  +my $val = shift;
  +$$val =~ s/\(($mm_replace)\)/(MODPERL_\U$perl_config_pm_alias{$1})/g;
  +}
  +
   sub make_tools {
   my($self, $fh) = @_;
   
  @@ -725,8 +730,13 @@
   
   for (qw(rm_f mv ld ar)) {
   my $val = $mm-{\U$_};
  -$val =~ s/\(($mm_replace)\)/(MODPERL_\U$perl_config_pm_alias{$1})/g;
  -print $fh $self-canon_make_attr($_ = $val || $Config{$_});
  +if ($val) {
  +mm_replace(\$val);
  +}
  +else {
  +$val = $Config{$_};
  +}
  +print $fh $self-canon_make_attr($_ = $val);
   }
   }
   
  
  
  



cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm

2001-10-20 Thread dougm

dougm   01/10/20 22:46:20

  Modified:lib/ModPerl WrapXS.pm
  Log:
  leave certain (e.g. ithreads only) functions out of the export lists
  
  Revision  ChangesPath
  1.28  +15 -1 modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- WrapXS.pm 2001/10/21 05:29:46 1.27
  +++ WrapXS.pm 2001/10/21 05:46:20 1.28
  @@ -640,6 +640,18 @@
  $val\n;
   }
   
  +#C::Scan doesnt always pickup static __inline__ of mpxs_ functions
  +#certain functions are only defined #ifdef USE_ITHREADS
  +#XXX might need a modperl_ithreads.{def,exp} if any xs modules reference
  +#these functions
  +
  +my $skip_exports = join '|', qw{
  +mpxs_
  +modperl_cmd_interp_
  +modperl_interp_ modperl_list_ modperl_tipool_
  +modperl_mgv_
  +};
  +
   sub write_export_file {
   my($self, $ext) = @_;
   
  @@ -661,9 +673,11 @@
   
   for my $entry (@$table) {
   next if $self-func_is_static($entry);
  +my $name = $entry-{name};
  +next if $name =~ /^($skip_exports)/o;
   my $fh = $self-func_is_inline($entry) ?
 $exp_inline_fh : $exp_fh;
  -print $fh $self-$format($entry-{name});
  +print $fh $self-$format($name);
   }
   
   for my $fh ($exp_fh, $exp_inline_fh) {
  
  
  



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

2001-10-20 Thread dougm

dougm   01/10/20 19:50:15

  Modified:lib/Apache Build.pm
  Log:
  use more Config.pm/MakeMaker variables to make win32 happier
  
  Revision  ChangesPath
  1.55  +8 -8  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- Build.pm  2001/10/20 18:59:28 1.54
  +++ Build.pm  2001/10/21 02:50:15 1.55
  @@ -704,7 +704,7 @@
   my $mm_replace = join '|', keys %perl_config_pm_alias;
   
   my @perl_config_pm =
  -  (qw(cc cpprun ld ar rm ranlib lib_ext dlext cccdlflags lddlflags),
  +  (qw(cc cpprun rm ranlib lib_ext dlext obj_ext cccdlflags lddlflags),
  values %perl_config_pm_alias);
   
   sub make_tools {
  @@ -723,7 +723,7 @@
   my $mm = bless {}, 'MM';
   $mm-init_others;
   
  -for (qw(RM_F MV)) {
  +for (qw(RM_F MV LD AR)) {
   my $val = $mm-{$_};
   $val =~ s/\(($mm_replace)\)/(MODPERL_\U$perl_config_pm_alias{$1})/g;
   print $fh $self-canon_make_attr($_ = $val);
  @@ -797,13 +797,13 @@
$(MODPERL_PIC_OBJS) $(MODPERL_LDOPTS)
$(MODPERL_RANLIB) $@
   
  -.SUFFIXES: .xs .c .o .lo .i .s
  +.SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s
   
   .c.lo:
$(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) \
  - -c $  $(MODPERL_MV) $*.o $*.lo
  + -c $  $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
   
  -.c.o:
  +.c$(MODPERL_OBJ_EXT):
$(MODPERL_CC) $(MODPERL_CCFLAGS) -c $
   
   .c.i:
  @@ -815,17 +815,17 @@
   .xs.c:
$(MODPERL_XSUBPP) $*.xs $@
   
  -.xs.o:
  +.xs$(MODPERL_OBJ_EXT):
$(MODPERL_XSUBPP) $*.xs $*.c
$(MODPERL_CC) $(MODPERL_CCFLAGS) -c $*.c
   
   .xs.lo:
$(MODPERL_XSUBPP) $*.xs $*.c
$(MODPERL_CC) $(MODPERL_CCFLAGS_SHLIB) \
  - -c $*.c  $(MODPERL_MV) $*.o $*.lo
  + -c $*.c  $(MODPERL_MV) $*$(MODPERL_OBJ_EXT) $*.lo
   
   clean:
  - $(MODPERL_RM_F) *.a *.so *.xsc *.o *.lo *.i *.s \
  + $(MODPERL_RM_F) *.a *.so *.xsc *$(MODPERL_OBJ_EXT) *.lo *.i *.s \
$(MODPERL_CLEAN_FILES) \
$(MODPERL_XS_CLEAN_FILES)
   
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-20 Thread dougm

dougm   01/10/20 22:48:13

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.38  +1 -43 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- FunctionTable.pm  2001/10/21 05:05:50 1.37
  +++ FunctionTable.pm  2001/10/21 05:48:13 1.38
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Sat Oct 20 22:13:10 2001
  +# !  Sat Oct 20 22:58:03 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -2955,48 +2955,6 @@
 {
   'type' = 'U32',
   'name' = 'hash'
  -  }
  -]
  -  },
  -  {
  -'return_type' = 'void',
  -'name' = 'modperl_perl_ids_get',
  -'args' = [
  -  {
  -'type' = 'modperl_perl_ids_t *',
  -'name' = 'ids'
  -  }
  -]
  -  },
  -  {
  -'return_type' = 'void',
  -'name' = 'modperl_perl_init_ids',
  -'args' = [
  -  {
  -'type' = 'PerlInterpreter *',
  -'name' = 'my_perl'
  -  },
  -  {
  -'type' = 'modperl_perl_ids_t *',
  -'name' = 'ids'
  -  }
  -]
  -  },
  -  {
  -'return_type' = 'apr_status_t',
  -'name' = 'modperl_perl_init_ids_mip',
  -'args' = [
  -  {
  -'type' = 'PerlInterpreter *',
  -'name' = 'my_perl'
  -  },
  -  {
  -'type' = 'modperl_interp_pool_t *',
  -'name' = 'mip'
  -  },
  -  {
  -'type' = 'void *',
  -'name' = 'data'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/pod modperl_dev.pod

2001-10-20 Thread dougm

dougm   01/10/20 11:30:40

  Modified:lib/ModPerl BuildOptions.pm
   pod  modperl_dev.pod
  Log:
  default to building mod_perl as a dso
  
  Revision  ChangesPath
  1.10  +4 -1  modperl-2.0/lib/ModPerl/BuildOptions.pm
  
  Index: BuildOptions.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BuildOptions.pm   2001/09/08 18:00:49 1.9
  +++ BuildOptions.pm   2001/10/20 18:30:39 1.10
  @@ -23,6 +23,8 @@
   if ($build-{MP_DEBUG} and $build-{MP_USE_GTOP}) {
   $build-{MP_USE_GTOP} = 0 unless $build-find_dlfile('gtop');
   }
  +
  +$build-{MP_USE_DSO} = 1 unless $build-{MP_USE_STATIC};
   }
   
   sub parse {
  @@ -151,7 +153,8 @@
   MAINTAINER   Maintainer mode: DEBUG=1 -DAP_DEBUG -Wall ...
   CCOPTS   Add to compiler flags
   TRACETurn on tracing
  -USE_DSO  Build mod_perl as a dso
  +USE_DSO  Build mod_perl as a dso
  +USE_STATIC   Build mod_perl static
   INST_APACHE2 Install *.pm relative to Apache2/ directory
   PROMPT_DEFAULT   Accept default value for all would-be prompts
   OPTIONS_FILE Read options from given file
  
  
  
  1.43  +6 -2  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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- modperl_dev.pod   2001/10/19 02:17:10 1.42
  +++ modperl_dev.pod   2001/10/20 18:30:40 1.43
  @@ -66,7 +66,7 @@
   =head2 Create the build environment
   
 % cd modperl-2.0
  -  % perl Makefile.PL MP_GENERATE_XS=1 MP_USE_DSO=1 \
  +  % perl Makefile.PL MP_GENERATE_XS=1 \
   MP_APXS=$apache_prefix/bin/apxs  make
   
   Ioptions an optional list of (key,value) pairs.
  @@ -85,7 +85,11 @@
   
   =item MP_USE_DSO
   
  -Build mod_perl as a DSO
  +Build mod_perl as a DSO (default)
  +
  +=item MP_USE_STATIC
  +
  +Build mod_perl static
   
   =item MP_STATIC_EXTS
   
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in

2001-10-19 Thread stas

stas01/10/18 23:46:25

  Modified:ModPerl-Registry/t/conf extra.conf.in
  Log:
  - prepare the configuration for a set of /same_interp aliases and registry
  configurations
  - some slight reorg of the conf file
  
  Revision  ChangesPath
  1.2   +73 -15modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- extra.conf.in 2001/10/09 12:47:38 1.1
  +++ extra.conf.in 2001/10/19 06:46:25 1.2
  @@ -4,29 +4,31 @@
   PerlSwitches -T
   
   PerlSwitches -Mlib=@ServerRoot@/../lib
  +PerlSwitches -Mlib=@ServerRoot@/../../Apache-Test/lib
   PerlSwitches -Mlib=@ServerRoot@/../../lib
   PerlSwitches -Mlib=@ServerRoot@/../../blib/lib
   PerlSwitches -Mlib=@ServerRoot@/../../blib/arch
   
  -Alias /registry/ @ServerRoot@/cgi-bin/
  -Alias /registry_ng/  @ServerRoot@/cgi-bin/
  -Alias /registry_bb/  @ServerRoot@/cgi-bin/
  -Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/
  -Alias /perlrun/  @ServerRoot@/cgi-bin/
  -
  -#PerlModule TestDebugMy
  -
  -PerlSetVar ModPerl::RegistryCooker::DEBUG 0
  -
  -### DEVMODE: Remove in production ###
  + DEVMODE: Remove in production ###
   PerlModule Apache::Reload
   PerlInitHandler Apache::Reload
   PerlSetVar ReloadAll Off
   PerlSetVar ReloadModules ModPerl::*
   
  +PerlSetVar ModPerl::RegistryCooker::DEBUG 2
  +
   PerlModule ModPerl::RegistryCooker
   PerlModule ModPerl::Util
   
  +#
  +### Normal registry setup ###
  +#
  +Alias /registry/ @ServerRoot@/cgi-bin/
  +Alias /registry_ng/  @ServerRoot@/cgi-bin/
  +Alias /registry_bb/  @ServerRoot@/cgi-bin/
  +Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/
  +Alias /perlrun/  @ServerRoot@/cgi-bin/
  +
   PerlModule ModPerl::RegistryNG
   Location /registry_ng
   PerlOptions +GlobalRequest
  @@ -45,6 +47,24 @@
   PerlOptions +ParseHeaders
   /Location
   
  +PerlModule ModPerl::Registry
  +Location /registry
  +  #  PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlResponseHandler ModPerl::Registry
  +PerlOptions +ParseHeaders
  +/Location
  +
  +# META: dumps core on OO handlers
  +Location /registry_oo_conf
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlResponseHandler ModPerl::Registry-handler
  +PerlOptions +ParseHeaders
  +/Location
  +
   PerlModule ModPerl::PerlRun
   Location /perlrun
   PerlOptions +GlobalRequest
  @@ -54,21 +74,59 @@
   PerlOptions +ParseHeaders
   /Location
   
  -PerlModule ModPerl::Registry
  -Location /registry
  +###
  +### Same interpreter registry setup ###
  +###
  +
  +Alias /same_interp/registry/ @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_ng/  @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_bb/  @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_oo_conf/ @ServerRoot@/cgi-bin/
  +Alias /same_interp/perlrun/  @ServerRoot@/cgi-bin/
  +
  +PerlModule Apache::TestHandler
  +Location /same_interp/registry_ng
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::RegistryNG
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/registry_bb
   PerlOptions +GlobalRequest
   SetHandler perl-script
   Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::RegistryBB
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/registry
  +  #  PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
   PerlResponseHandler ModPerl::Registry
   PerlOptions +ParseHeaders
   /Location
   
  -# META: dumps core on OO handlers
  -Location /registry_oo_conf
  +Location /same_interp/registry_oo_conf
   PerlOptions +GlobalRequest
   SetHandler perl-script
   Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
   PerlResponseHandler ModPerl::Registry-handler
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/perlrun
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::PerlRun
   PerlOptions +ParseHeaders
   /Location
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_handler.h modperl_perl_global.h modperl_types.h

2001-10-19 Thread dougm

dougm   01/10/19 09:40:45

  Modified:src/modules/perl modperl_handler.h modperl_perl_global.h
modperl_types.h
  Log:
  get rid of hpux warnings:
  Dangling comma not allowed by ANSI standard, ignored.
  
  Revision  ChangesPath
  1.8   +1 -1  modperl-2.0/src/modules/perl/modperl_handler.h
  
  Index: modperl_handler.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_handler.h 2001/04/19 17:57:15 1.7
  +++ modperl_handler.h 2001/10/19 16:40:44 1.8
  @@ -4,7 +4,7 @@
   typedef enum {
   MP_HANDLER_ACTION_GET,
   MP_HANDLER_ACTION_PUSH,
  -MP_HANDLER_ACTION_SET,
  +MP_HANDLER_ACTION_SET
   } modperl_handler_action_e;
   
   #define modperl_handler_array_new(p) \
  
  
  
  1.10  +1 -1  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- modperl_perl_global.h 2001/10/13 19:02:03 1.9
  +++ modperl_perl_global.h 2001/10/19 16:40:44 1.10
  @@ -9,7 +9,7 @@
   } modperl_modglobal_key_t;
   
   typedef enum {
  -MP_MODGLOBAL_END,
  +MP_MODGLOBAL_END
   } modperl_modglobal_key_e;
   
   typedef struct {
  
  
  
  1.52  +2 -2  modperl-2.0/src/modules/perl/modperl_types.h
  
  Index: modperl_types.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- modperl_types.h   2001/09/28 19:51:40 1.51
  +++ modperl_types.h   2001/10/19 16:40:44 1.52
  @@ -107,7 +107,7 @@
   MP_INTERP_SCOPE_HANDLER,
   MP_INTERP_SCOPE_SUBREQUEST,
   MP_INTERP_SCOPE_REQUEST,
  -MP_INTERP_SCOPE_CONNECTION,
  +MP_INTERP_SCOPE_CONNECTION
   } modperl_interp_scope_e;
   
   typedef struct {
  @@ -176,7 +176,7 @@
   
   typedef enum {
   MP_INPUT_FILTER_MODE,
  -MP_OUTPUT_FILTER_MODE,
  +MP_OUTPUT_FILTER_MODE
   } modperl_filter_mode_e;
   
   typedef struct {
  
  
  



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

2001-10-19 Thread stas

stas01/10/19 03:37:20

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  - module cleanup, moving XXX/META's into the todo list
  
  Revision  ChangesPath
  1.4   +35 -75modperl-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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegistryCooker.pm 2001/10/19 07:35:26 1.3
  +++ RegistryCooker.pm 2001/10/19 10:37:20 1.4
  @@ -16,9 +16,6 @@
   our $VERSION = '1.99';
   
   use Apache::compat ();
  -# META: Should not use Apache::compat, the following methods need to
  -# be implemented:
  -# $r-slurp_filename
   
   use Apache::Response;
   use Apache::Log;
  @@ -27,27 +24,10 @@
   use ModPerl::Util ();
   use ModPerl::Global ();
   
  -#
  -# issues
  -#
  -#
  -
  -# META: who sets this? What's the default?
   unless (defined $ModPerl::Registry::MarkLine) {
   $ModPerl::Registry::MarkLine = 1;
   }
   
  -### Optimizations
  -#
  -# - $o-[CLASS] of the subclass is known at compile time, so should
  -#   create the subs using $o-[CLASS] on the fly for each subclass
  -#   which wants them
  -
  -### TODO
  -#
  -# - who handles END/BEGIN/,CHECK,INIT) blocks?
  -# - see META's accross the file
  -
   #
   # debug constants
   #
  @@ -58,9 +38,9 @@
   use constant D_COMPILE = 4;
   use constant D_NOISE   = 8;
   
  -# can override the debug level in httpd.conf with:
  +# the debug level can be overriden on the main server level of
  +# 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')
  @@ -96,26 +76,6 @@
   
   
   #
  -# install the aliases into $class
  -#
  -#
  -
  -sub install_aliases {
  -my ($class, $rh_aliases) = @_;
  -
  -no strict 'refs';
  -while (my($k,$v) = each %$rh_aliases) {
  -if (my $sub = *{$v}{CODE}){
  -#warn $class: ok: $k = $v;
  -*{ $class . ::$k } = $sub;
  -}
  -else {
  -die $class: $k aliasing failed; sub $v doesn't exist;
  -}
  -}
  -}
  -
  -#
   # func: new
   # dflt: new
   # args: $class - class to bless into
  @@ -128,7 +88,6 @@
   my($class, $r) = @_;
   my $o = bless [], $class;
   $o-init($r);
  -#$o-debug($$: init class: $class);
   return $o;
   }
   
  @@ -160,7 +119,6 @@
   #   __PACKAGE__, which is tied to the file)
   #
   
  -# META: prototyping ($$) segfaults on request
   sub handler {
   my $class = (@_ = 2) ? shift : __PACKAGE__;
   my $r = shift;
  @@ -219,7 +177,6 @@
   
   $o-flush_namespace;
   
  -# META: handle!
   #$o-chdir_file($Apache::Server::CWD/);
   
   if ( ($rc = $o-error_check) != Apache::OK) {
  @@ -291,9 +248,6 @@
   # make sure that the sub-package doesn't start with a digit
   $package = _$package;
   
  -# META: ??? explain
  -$ModPerl::Registry::curstash = $package;
  -
   # prepend root
   $package = $o-[CLASS] . ::Cache::$package;
   
  @@ -331,12 +285,6 @@
substr($o-[URI], 0, length($o-[URI]) - length($path_info)) :
$o-[URI];
   
  -# META: do we handle this?
  -# if ($ModPerl::Registry::NameWithVirtualHost  $o-[REQ]-server-is_virtual) 
{
  -#  my $name = $o-[REQ]-get_server_name;
  -#  $script_name = join , $name, $script_name if $name;
  -# }
  -
   $script_name =~ s:/+$:/__INDEX__:;
   
   return $script_name;
  @@ -365,10 +313,7 @@
   # relative require/open will work.
   $o-chdir_file;
   
  -# META: what's this?
  -## compile this subroutine into the uniq package name
  -#$o-debug(handler eval-ing) if DEBUG  D_NOISE;
  -#undef {$o-[PACKAGE]\::handler};# unless $Debug  $Debug  4; #avoid 
warnings
  +#undef {$o-[PACKAGE]\::handler}; unless DEBUG  D_NOISE; #avoid warnings
   #$o-[PACKAGE]-can('undef_functions')  $o-[PACKAGE]-undef_functions;
   
   my $line = $o-get_mark_line;
  @@ -385,22 +330,18 @@
   
   my %orig_inc = %INC;
   
  -#warn [-- $eval --];
   my $rc = $o-compile(\$eval);
   $o-debug(qq{compiled package \$o-[PACKAGE]\}) if DEBUG  D_NOISE;
   
  -# META: handle!
   #$o-chdir_file

cvs commit: modperl-2.0/ModPerl-Registry TODO

2001-10-19 Thread stas

stas01/10/19 03:43:25

  Modified:ModPerl-Registry TODO
  Log:
  - summarize things that have to be done for Registry
  
  Revision  ChangesPath
  1.2   +44 -26modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TODO  2001/10/09 12:47:38 1.1
  +++ TODO  2001/10/19 10:43:25 1.2
  @@ -1,36 +1,54 @@
  -- META tags in the modules
  +RegistryCooker:
   
  
  +### bugs ###
   
  - - print STDERR is buffered in test handlers, whereas warn() works
  -   normally. select() helps, but STDERR should be unbuffered in first
  -   place.
  +- prototyping sub handler($$) segfaults on request
   
  
  +### missing features ###
   
  - what's the replacement of NameWithVirtualHost? Obviously we need something
  - to distinguish between vhs.
  +- need to port $Apache::__T, to test against when user supplies -T flag.
   
  -DougM: well, if possible we should distinguish between the uri and
  -requested resource instead.  in otherwords, we have the: r-uri =
  -r-filename translation, just need to figure out if r-filename is the
  -actual filename or a symlink (readlink can be used to get the real
  -filename).  then create a package based on the filename, but with as
  -few package:: levels as possible (hopefully none beyond
  -ModPerl::RegistryROOT::filename)
  +- port Apache::PerlRunXS
   
  -DougM: using filenames makes for long packages names == lengthy
  -lookups and more memory than we need.  at least the way it is
  -currently implemented where each '/' turns into '::'.  could be that
  -s,/,_,g is good enough, but haven't thought about this for a while.
  -in any case, we should get rid of the NameWithVirtualHost stuff, its
  -caused too many problems in the past.
  +- implement RegistryLoader (per module or a single one?)
   
  
  +- implement slurp_filename and remove Apache::compat
   
  -Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
  -http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
  -Message-ID: [EMAIL PROTECTED]
  +- $r-chdir_file is not handled/implemented, see todo/api.txt unsafe!
   
  
  +- $Apache::Server::CWD doesn't exist
  +
  +- NameWithVirtualHost is not handled
  +
  +- need to figure out what's happening with
  +  ModPerl::Registry::MarkLine, why it's not on by default?
  +
  +- a cousin of convert_script_to_compiled_handler() in 1.x used to have
  +  'undef {$o-[PACKAGE]\::handler}' to avoid redefine handler()
  +  warnings in case a user has used -w. also see the undef_functions on
  +  the next line.
  +
  +- child_terminate is not implemented see
  +  convert_script_to_compiled_handler().
  +
  +- print STDERR is buffered in test handlers, whereas warn() works
  +  normally. select() helps, but STDERR should be unbuffered in first
  +  place.
  +
  +### optimizations ###
  +
  +- $o-[CLASS] of the subclass is known at compile time, so should
  +  create the subs using $o-[CLASS] on the fly for each subclass
  +  which wants them
  +
  +### nice to have ###
  +
  +- in namespace_from_filename() should test whether a file is a symlink
  +  and if so use readlink() to get the real filename.
  +
  +### other things ###
  +
  +- Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
  +  http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
  +  Message-ID: [EMAIL PROTECTED]
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_time.h

2001-10-19 Thread stas

stas01/10/19 20:35:54

  Modified:src/modules/perl modperl_time.h
  Log:
  - handle platforms which don't have HZ constant defined
  
  Revision  ChangesPath
  1.2   +8 -2  modperl-2.0/src/modules/perl/modperl_time.h
  
  Index: modperl_time.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_time.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_time.h2001/01/21 23:19:03 1.1
  +++ modperl_time.h2001/10/20 03:35:54 1.2
  @@ -1,6 +1,12 @@
   #ifndef MODPERL_TIME_H
   #define MODPERL_TIME_H
   
  +#ifdef HZ
  +#   define MP_HZ HZ
  +#else
  +#   define MP_HZ 100
  +#endif
  +
   #ifdef MP_TRACE
   #define dMP_TIMES \
   struct tms start_time; \
  @@ -18,9 +24,9 @@
   #define MP_PRINT_TIMES(label) \
   MP_TRACE_t_do({ \
   double utime = \
  - (double)(end_time.tms_utime - start_time.tms_utime)/HZ; \
  + (double)(end_time.tms_utime - start_time.tms_utime)/MP_HZ; \
   double stime = \
  - (double)(end_time.tms_stime - start_time.tms_stime)/HZ; \
  + (double)(end_time.tms_stime - start_time.tms_stime)/MP_HZ; \
   if (utime || stime) { \
   MP_TRACE_t(MP_FUNC, %s %5.2f user %5.2f sys\n, \
  label, utime, stime); \
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry .cvsignore

2001-10-18 Thread stas

stas01/10/18 20:00:15

  Modified:ModPerl-Registry .cvsignore
  Log:
  ignore files
  
  Revision  ChangesPath
  1.2   +1 -0  modperl-2.0/ModPerl-Registry/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore2001/10/18 04:25:12 1.1
  +++ .cvsignore2001/10/19 03:00:15 1.2
  @@ -1,2 +1,3 @@
   Makefile
   pm_to_blib
  +blib
  
  
  



cvs commit: modperl-2.0/pod modperl_dev.pod

2001-10-18 Thread stas

stas01/10/18 19:17:10

  Modified:pod  modperl_dev.pod
  Log:
  - document the existance of PerlInitHandler
  
  Revision  ChangesPath
  1.42  +2 -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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- modperl_dev.pod   2001/09/28 20:23:04 1.41
  +++ modperl_dev.pod   2001/10/19 02:17:10 1.42
  @@ -473,6 +473,8 @@
   
   =item PerlPostReadRequestHandler
   
  +=item PerlInitHandler
  +
   =item PerlTransHandler
   
   =back
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t TEST.PL

2001-10-18 Thread stas

stas01/10/18 19:40:41

  Modified:ModPerl-Registry/t TEST.PL
  Log:
  - allow 2 maxclients, since some tests generate two requests at the same
  time (one from within the other)
  
  Revision  ChangesPath
  1.2   +15 -8 modperl-2.0/ModPerl-Registry/t/TEST.PL
  
  Index: TEST.PL
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/TEST.PL,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TEST.PL   2001/10/09 12:47:38 1.1
  +++ TEST.PL   2001/10/19 02:40:41 1.2
  @@ -3,15 +3,22 @@
   use strict;
   use warnings FATAL = 'all';
   
  -# XXX: fixme
  -#use lib map { $_/Apache-Test/lib } qw(. ..);
  -#use lib map { $_/blib/lib} qw(. .. ../..);
  -#use lib map { $_/lib } qw(. .. ../..);
  -#use blib map { $_ } qw(. .. ../..);
  -
   use lib map {(../blib/$_, ../../blib/$_)} qw(lib arch);
  -#use blib qw(..);
   
   use Apache::TestRunPerl ();
  +
  +package MyTest;
  +
  +our @ISA = qw(Apache::TestRunPerl);
  +
  +# subclass new_test_config to add some config vars which will be
  +# replaced in generated httpd.conf
  +sub new_test_config {
  +my $self = shift;
  +
  +$self-{conf_opts}-{maxclients} = 2;
  +
  +return $self-SUPER::new_test_config;
  +}
   
  -Apache::TestRunPerl-new-run(@ARGV);
  +MyTest-new-run(@ARGV);
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf .cvsignore

2001-10-18 Thread stas

stas01/10/18 19:58:57

  Modified:ModPerl-Registry/t/conf .cvsignore
  Log:
  ignore files
  
  Revision  ChangesPath
  1.2   +3 -0  modperl-2.0/ModPerl-Registry/t/conf/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore2001/10/09 12:47:38 1.1
  +++ .cvsignore2001/10/19 02:58:57 1.2
  @@ -1,3 +1,6 @@
   extra.conf
   httpd.conf
   apache_test_config.pm
  +modperl_inc.pl
  +modperl_startup.pl
  +
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t .cvsignore

2001-10-17 Thread stas

stas01/10/17 21:25:12

  Modified:ModPerl-Registry/t .cvsignore
  Added:   ModPerl-Registry .cvsignore
  Log:
  - cvsignore files
  
  Revision  ChangesPath
  1.1  modperl-2.0/ModPerl-Registry/.cvsignore
  
  Index: .cvsignore
  ===
  Makefile
  pm_to_blib
  
  
  
  1.2   +1 -0  modperl-2.0/ModPerl-Registry/t/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore2001/10/09 12:47:38 1.1
  +++ .cvsignore2001/10/18 04:25:12 1.2
  @@ -1,2 +1,3 @@
   logs
   htdocs
  +TEST
  
  
  



Re: cvs commit: modperl-2.0/ModPerl-Registry/t .cvsignore

2001-10-17 Thread Stas Bekman

[EMAIL PROTECTED] wrote:

 stas01/10/17 21:25:12
 
   Modified:ModPerl-Registry/t .cvsignore
   Added:   ModPerl-Registry .cvsignore
   Log:
   - cvsignore files


Any idea why I don't get the

   Submitted by:

and other commit headers while doing cvs commit under this dir?

Philippe has submitted this patch, but I had no place to indicate this. 
Sorry Philippe

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: cvs commit: modperl-2.0/ModPerl-Registry/t .cvsignore

2001-10-17 Thread Philippe M. Chiasson

On Thu, Oct 18, 2001 at 12:35:06PM +0800, Stas Bekman wrote:
 [EMAIL PROTECTED] wrote:
 
  stas01/10/17 21:25:12
  
Modified:ModPerl-Registry/t .cvsignore
Added:   ModPerl-Registry .cvsignore
Log:
- cvsignore files
 
 
 Any idea why I don't get the
 
Submitted by:
 
 and other commit headers while doing cvs commit under this dir?
 
 Philippe has submitted this patch, but I had no place to indicate this. 
 Sorry Philippe

Oh, this is not quite terrible, .cvsignore patch isn't very sexy or important
for posterity !

 
 _
 Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
 http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
 mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
 http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
 

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

/* Am I fucking pedantic or what? */ 
-- Linux2.2.16
/usr/src/linux/drivers/scsi/qlogicpti.h

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

 PGP signature


Re: cvs commit: modperl-2.0/ModPerl-Registry/t .cvsignore

2001-10-17 Thread Stas Bekman

Philippe M. Chiasson wrote:

 On Thu, Oct 18, 2001 at 12:35:06PM +0800, Stas Bekman wrote:
 
[EMAIL PROTECTED] wrote:


stas01/10/17 21:25:12

  Modified:ModPerl-Registry/t .cvsignore
  Added:   ModPerl-Registry .cvsignore
  Log:
  - cvsignore files


Any idea why I don't get the

   Submitted by:

and other commit headers while doing cvs commit under this dir?

Philippe has submitted this patch, but I had no place to indicate this. 
Sorry Philippe

 
 Oh, this is not quite terrible, .cvsignore patch isn't very sexy or important
 for posterity !

I know :) But you probably want to get the due credits for your future 
sexy patches, aren't you :)

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




cvs commit: modperl-2.0/xs .cvsignore

2001-10-17 Thread stas

stas01/10/17 00:25:13

  Modified:xs   .cvsignore
  Log:
  - ignore *.def
  
  Revision  ChangesPath
  1.3   +1 -0  modperl-2.0/xs/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/xs/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore2001/10/09 18:19:36 1.2
  +++ .cvsignore2001/10/17 07:25:13 1.3
  @@ -4,3 +4,4 @@
   modperl_xs_sv_convert.h
   apache.exp
   modperl.exp
  +*.def
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-17 Thread dougm

dougm   01/10/17 10:38:07

  Modified:.Makefile.PL
  Log:
  undo undo of explicit DIR in WriteMakefile; problem seems to have gone away
  
  Revision  ChangesPath
  1.45  +1 -1  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- Makefile.PL   2001/10/15 16:50:47 1.44
  +++ Makefile.PL   2001/10/17 17:38:07 1.45
  @@ -27,7 +27,7 @@
   ModPerl::MM::WriteMakefile(
   NAME = 'mod_perl',
   VERSION = $VERSION,
  -#DIR = get_dirs_with_makefile(@remote_makefile_dirs),
  +DIR = get_dirs_with_makefile(@remote_makefile_dirs),
   macro = {
   MODPERL_SRC   = $code-path,
   PERL  = $build-perl_config('perlpath'),
  
  
  



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
  
  
  



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

2001-10-13 Thread dougm

dougm   01/10/13 11:55:03

  Modified:src/modules/perl modperl_perl_global.c modperl_perl_global.h
  Log:
  s/hv_fetch/hv_fetch_he/g
  
  Revision  ChangesPath
  1.10  +24 -9 modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- modperl_perl_global.c 2001/10/08 21:09:08 1.9
  +++ modperl_perl_global.c 2001/10/13 18:55:03 1.10
  @@ -12,8 +12,14 @@
   
   /* XXX: PL_modglobal thingers might be useful elsewhere */
   
  +#define MP_MODGLOBAL_FETCH(gkey) \
  +hv_fetch_he(PL_modglobal, (char *)gkey-val, gkey-len, gkey-hash)
  +
  +#define MP_MODGLOBAL_STORE_HV(gkey) \
  +(HV*)*hv_store(PL_modglobal, gkey-val, gkey-len, (SV*)newHV(), gkey-hash)
  +
   #define MP_MODGLOBAL_ENT(key) \
  -{key, ModPerl:: key, (sizeof(ModPerl::)-1)+(sizeof(key)-1)}
  +{key, ModPerl:: key, (sizeof(ModPerl::)-1)+(sizeof(key)-1), 0}
   
   static modperl_modglobal_key_t MP_modglobal_keys[] = {
   MP_MODGLOBAL_ENT(END),
  @@ -36,18 +42,18 @@
   static AV *modperl_perl_global_avcv_fetch(pTHX_ modperl_modglobal_key_t *gkey,
 const char *package, I32 packlen)
   {
  -SV **svp = hv_fetch(PL_modglobal, gkey-val, gkey-len, FALSE);
  +HE *he = MP_MODGLOBAL_FETCH(gkey);
   HV *hv;
   
  -if (!(svp  (hv = (HV*)*svp))) {
  +if (!(he  (hv = (HV*)HeVAL(he {
   return Nullav;
   }
   
  -if (!(svp = hv_fetch(hv, package, packlen, FALSE))) {
  +if (!(he = hv_fetch_he(hv, (char *)package, packlen, 0))) {
   return Nullav;
   }
   
  -return (AV*)*svp;
  +return (AV*)HeVAL(he);
   }
   
   void modperl_perl_global_avcv_call(pTHX_ modperl_modglobal_key_t *gkey,
  @@ -76,6 +82,7 @@
   
   static int modperl_perl_global_avcv_set(pTHX_ SV *sv, MAGIC *mg)
   {
  +HE *he;
   HV *hv;
   AV *mav, *av = (AV*)sv;
   const char *package = HvNAME(PL_curstash);
  @@ -83,11 +90,19 @@
   modperl_modglobal_key_t *gkey =
   (modperl_modglobal_key_t *)mg-mg_ptr;
   
  -hv = (HV*)*hv_fetch(PL_modglobal, gkey-val, gkey-len, TRUE);
  -(void)SvUPGRADE((SV*)hv, SVt_PVHV);
  +if ((he = MP_MODGLOBAL_FETCH(gkey))) {
  +hv = (HV*)HeVAL(he);
  +}
  +else {
  +hv = MP_MODGLOBAL_STORE_HV(gkey);
  +}
   
  -mav = (AV*)*hv_fetch(hv, package, packlen, TRUE);
  -(void)SvUPGRADE((SV*)mav, SVt_PVAV);
  +if ((he = hv_fetch_he(hv, (char *)package, packlen, 0))) {
  +mav = (AV*)HeVAL(he);
  +}
  +else {
  +mav = (AV*)*hv_store(hv, package, packlen, (SV*)newAV(), 0);
  +}
   
   /* $cv = pop @av */
   sv = AvARRAY(av)[AvFILLp(av)];
  
  
  
  1.8   +1 -0  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl_global.h 2001/10/07 22:07:15 1.7
  +++ modperl_perl_global.h 2001/10/13 18:55:03 1.8
  @@ -5,6 +5,7 @@
   const char *name;
   const char *val;
   I32 len;
  +U32 hash;
   } modperl_modglobal_key_t;
   
   typedef enum {
  
  
  



cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_perl_global.c modperl_perl_global.h

2001-10-13 Thread dougm

dougm   01/10/13 12:02:03

  Modified:src/modules/perl mod_perl.c modperl_perl_global.c
modperl_perl_global.h
  Log:
  calculate hash of MP_modglobal_keys keys at startup
  
  Revision  ChangesPath
  1.91  +1 -0  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.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- mod_perl.c2001/10/11 04:47:30 1.90
  +++ mod_perl.c2001/10/13 19:02:03 1.91
  @@ -332,6 +332,7 @@
   ap_add_version_component(pconf,
Perl_form(aTHX_ Perl/v%vd, PL_patchlevel));
   modperl_mgv_hash_handlers(pconf, s);
  +modperl_modglobal_hash_keys();
   #ifdef USE_ITHREADS
   modperl_init_clones(s, pconf);
   #endif
  
  
  
  1.11  +10 -0 modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- modperl_perl_global.c 2001/10/13 18:55:03 1.10
  +++ modperl_perl_global.c 2001/10/13 19:02:03 1.11
  @@ -26,6 +26,16 @@
   { NULL },
   };
   
  +void modperl_modglobal_hash_keys(void)
  +{
  +modperl_modglobal_key_t *gkey = MP_modglobal_keys;
  +
  +while (gkey-name) {
  +PERL_HASH(gkey-hash, gkey-val, gkey-len);
  +gkey++;
  +}
  +}
  +
   modperl_modglobal_key_t *modperl_modglobal_lookup(pTHX_ const char *name)
   {
   int i;
  
  
  
  1.9   +2 -0  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_perl_global.h 2001/10/13 18:55:03 1.8
  +++ modperl_perl_global.h 2001/10/13 19:02:03 1.9
  @@ -49,6 +49,8 @@
   modperl_perl_global_svpv_t rs;
   } modperl_perl_globals_t;
   
  +void modperl_modglobal_hash_keys(void);
  +
   modperl_modglobal_key_t *modperl_modglobal_lookup(pTHX_ const char *name);
   
   void modperl_perl_global_request_save(pTHX_ request_rec *r);
  
  
  



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

2001-10-13 Thread dougm

dougm   01/10/13 12:05:16

  Modified:src/modules/perl modperl_perl_global.c
  Log:
  use consistent style to iterate over MP_modglobal_keys
  
  Revision  ChangesPath
  1.12  +5 -4  modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- modperl_perl_global.c 2001/10/13 19:02:03 1.11
  +++ modperl_perl_global.c 2001/10/13 19:05:16 1.12
  @@ -38,12 +38,13 @@
   
   modperl_modglobal_key_t *modperl_modglobal_lookup(pTHX_ const char *name)
   {
  -int i;
  +modperl_modglobal_key_t *gkey = MP_modglobal_keys;
   
  -for (i=0; MP_modglobal_keys[i].name; i++) {
  -if (strEQ(MP_modglobal_keys[i].name, name)) {
  -return MP_modglobal_keys[i];
  +while (gkey-name) {
  +if (strEQ(gkey-name, name)) {
  +return gkey;
   }
  +gkey++;
   }
   
   return NULL;
  
  
  



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

2001-10-13 Thread dougm

dougm   01/10/13 12:12:17

  Modified:src/modules/perl modperl_env.c
  Log:
  s/modperl_env_const_vars/MP_env_const_vars/g
  
  Revision  ChangesPath
  1.14  +4 -4  modperl-2.0/src/modules/perl/modperl_env.c
  
  Index: modperl_env.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_env.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- modperl_env.c 2001/10/13 19:11:32 1.13
  +++ modperl_env.c 2001/10/13 19:12:17 1.14
  @@ -31,7 +31,7 @@
   #define MP_ENV_ENT(k,v) \
   { k, sizeof(k)-1, v, sizeof(v)-1, 0 }
   
  -static modperl_env_ent_t modperl_env_const_vars[] = {
  +static modperl_env_ent_t MP_env_const_vars[] = {
   #ifdef MP_COMPAT_1X
   MP_ENV_ENT(GATEWAY_INTERFACE, CGI-Perl/1.1),
   #endif
  @@ -41,7 +41,7 @@
   
   void modperl_env_hash_keys(void)
   {
  -modperl_env_ent_t *ent = modperl_env_const_vars;
  +modperl_env_ent_t *ent = MP_env_const_vars;
   
   while (ent-key) {
   PERL_HASH(ent-hash, ent-key, ent-klen);
  @@ -69,8 +69,8 @@
   
   modperl_env_untie(mg_flags);
   
  -for (i = 0; modperl_env_const_vars[i].key; i++) {
  -const modperl_env_ent_t *ent = modperl_env_const_vars[i];
  +for (i = 0; MP_env_const_vars[i].key; i++) {
  +const modperl_env_ent_t *ent = MP_env_const_vars[i];
   
   hv_store(hv, ent-key, ent-klen,
newSVpvn(ent-val, ent-vlen), ent-hash);
  
  
  



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

2001-10-13 Thread dougm

dougm   01/10/13 12:14:58

  Modified:src/modules/perl modperl_env.c
  Log:
  use consistent style to iterate over MP_env_const_vars
  
  Revision  ChangesPath
  1.15  +3 -4  modperl-2.0/src/modules/perl/modperl_env.c
  
  Index: modperl_env.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_env.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- modperl_env.c 2001/10/13 19:12:17 1.14
  +++ modperl_env.c 2001/10/13 19:14:58 1.15
  @@ -63,17 +63,16 @@
   
   void modperl_env_default_populate(pTHX)
   {
  +modperl_env_ent_t *ent = MP_env_const_vars;
   HV *hv = ENVHV;
   U32 mg_flags;
  -int i;
   
   modperl_env_untie(mg_flags);
   
  -for (i = 0; MP_env_const_vars[i].key; i++) {
  -const modperl_env_ent_t *ent = MP_env_const_vars[i];
  -
  +while (ent-key) {
   hv_store(hv, ent-key, ent-klen,
newSVpvn(ent-val, ent-vlen), ent-hash);
  +ent++;
   }
   
   modperl_env_tie(mg_flags);
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_mgv.c modperl_util.c modperl_util.h

2001-10-12 Thread dougm

dougm   01/10/12 20:22:15

  Modified:src/modules/perl modperl_mgv.c modperl_util.c modperl_util.h
  Log:
  making modperl_perl_hv_fetch_he a public function
  
  Revision  ChangesPath
  1.15  +0 -33 modperl-2.0/src/modules/perl/modperl_mgv.c
  
  Index: modperl_mgv.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- modperl_mgv.c 2001/04/25 03:13:58 1.14
  +++ modperl_mgv.c 2001/10/13 03:22:15 1.15
  @@ -17,39 +17,6 @@
   #define modperl_mgv_new_namen(mgv, p, n) \
   modperl_mgv_new_w_name(mgv, p, n, 0)
   
  -/*
  - * similar to hv_fetch_ent, but takes string key and key len rather than SV
  - * also skips magic and utf8 fu, since we are only dealing with symbol tables
  - */
  -static HE *S_hv_fetch_he(pTHX_ HV *hv,
  - register char *key,
  - register I32 klen,
  - register U32 hash)
  -{
  -register XPVHV *xhv;
  -register HE *entry;
  -
  -xhv = (XPVHV *)SvANY(hv);
  -if (!xhv-xhv_array) {
  -return 0;
  -}
  -entry = ((HE**)xhv-xhv_array)[hash  (I32) xhv-xhv_max];
  -
  -for (; entry; entry = HeNEXT(entry)) {
  -if (HeHASH(entry) != hash)
  -continue;
  -if (HeKLEN(entry) != klen)
  -continue;
  -if (HeKEY(entry) != key  memNE(HeKEY(entry),key,klen))
  -continue;
  -return entry;
  -}
  -
  -return 0;
  -}
  -
  -#define hv_fetch_he(hv,k,l,h) S_hv_fetch_he(aTHX_ hv,k,l,h)
  -
   int modperl_mgv_equal(modperl_mgv_t *mgv1,
 modperl_mgv_t *mgv2)
   {
  
  
  
  1.26  +35 -0 modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- modperl_util.c2001/10/08 23:34:07 1.25
  +++ modperl_util.c2001/10/13 03:22:15 1.26
  @@ -399,6 +399,41 @@
   }
   }
   
  +/*
  + * similar to hv_fetch_ent, but takes string key and key len rather than SV
  + * also skips magic and utf8 fu, since we are only dealing with internal tables
  + */
  +HE *modperl_perl_hv_fetch_he(pTHX_ HV *hv,
  + register char *key,
  + register I32 klen,
  + register U32 hash)
  +{
  +register XPVHV *xhv;
  +register HE *entry;
  +
  +xhv = (XPVHV *)SvANY(hv);
  +if (!xhv-xhv_array) {
  +return 0;
  +}
  +
  +entry = ((HE**)xhv-xhv_array)[hash  (I32)xhv-xhv_max];
  +
  +for (; entry; entry = HeNEXT(entry)) {
  +if (HeHASH(entry) != hash) {
  +continue;
  +}
  +if (HeKLEN(entry) != klen) {
  +continue;
  +}
  +if (HeKEY(entry) != key  memNE(HeKEY(entry), key, klen)) {
  +continue;
  +}
  +return entry;
  +}
  +
  +return 0;
  +}
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name)
   {
   I32 i, oldscope = PL_scopestack_ix;
  
  
  
  1.25  +8 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_util.h2001/10/08 23:34:07 1.24
  +++ modperl_util.h2001/10/13 03:22:15 1.25
  @@ -68,6 +68,14 @@
   
   MP_INLINE void modperl_perl_av_push_elts_ref(pTHX_ AV *dst, AV *src);
   
  +HE *modperl_perl_hv_fetch_he(pTHX_ HV *hv,
  + register char *key,
  + register I32 klen,
  + register U32 hash);
  +
  +#define hv_fetch_he(hv,k,l,h) \
  +modperl_perl_hv_fetch_he(aTHX_ hv, k, l, h)
  +
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name);
   
   void modperl_perl_exit(pTHX_ int status);
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_config.h

2001-10-11 Thread dougm

dougm   01/10/11 08:38:23

  Modified:src/modules/perl modperl_config.h
  Log:
  add MP_dTHX macro
  
  Revision  ChangesPath
  1.28  +10 -0 modperl-2.0/src/modules/perl/modperl_config.h
  
  Index: modperl_config.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- modperl_config.h  2001/08/08 16:20:31 1.27
  +++ modperl_config.h  2001/10/11 15:38:23 1.28
  @@ -59,6 +59,16 @@
   #   define MP_dSCFG_dTHX dTHXa(scfg-perl)
   #endif
   
  +/* hopefully this macro will not need to be used often */
  +#ifdef USE_ITHREADS
  +#   define MP_dTHX \
  +modperl_interp_t *interp = \
  +   modperl_interp_select(r, r-connection, r-server); \
  +dTHXa(interp-perl)
  +#else
  +#   define MP_dTHX dNOOP
  +#endif
  +
   int modperl_config_apply_PerlModule(server_rec *s,
   modperl_config_srv_t *scfg,
   PerlInterpreter *perl, apr_pool_t *p);
  
  
  



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

2001-10-11 Thread dougm

dougm   01/10/11 12:32:43

  Modified:lib/Apache Build.pm
  Log:
  fixup ldopts for hpux
  
  Revision  ChangesPath
  1.48  +8 -0  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Build.pm  2001/09/13 02:01:31 1.47
  +++ Build.pm  2001/10/11 19:32:43 1.48
  @@ -127,6 +127,14 @@
   my $ldopts = ExtUtils::Embed::ldopts();
   chomp $ldopts;
   
  +if ($^O eq 'hpux' and $Config{ld} eq 'ld') {
  +while ($ldopts =~ s/-Wl,(\S+)/$1/) {
  +my $cp = $1;
  +(my $repl = $cp) =~ s/,/ /g;
  +$ldopts =~ s/\Q$cp/$repl/;
  +}
  +}
  +
   if ($self-{MP_USE_GTOP}) {
   $ldopts .= $self-gtop_ldopts;
   }
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-11 Thread dougm

dougm   01/10/11 12:48:08

  Modified:.Makefile.PL
  Log:
  add os specific sanity checks starting with hpux
  
  Revision  ChangesPath
  1.43  +19 -0 modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- Makefile.PL   2001/10/11 03:29:32 1.42
  +++ Makefile.PL   2001/10/11 19:48:08 1.43
  @@ -181,6 +181,7 @@
   
   $build-lib_check('gdbm');
   malloc_check();
  +os_check();
   }
   
   sub malloc_check {
  @@ -200,6 +201,24 @@
   }
   }
   
  +sub os_check {
  +my $check = \{os_check_$^O};
  +return unless defined $check;
  +$check-()
  +}
  +
  +sub os_check_hpux {
  +my $ccflags = $build-perl_config('ccflags');
  +
  +if ($build-{MP_USE_DSO} and $Config{ld} eq 'ld') {
  +unless ($ccflags =~ /\+z/i) {
  +$build-phat_warn(EOF);
  +mod_perl is unlikely to link with your libperl, suggestions:
  +*) Rebuild Perl with Configure -Accflags=+Z ...
  +EOF
  +}
  +}
  +}
   
   # by default only Makefile.PL's in the first level sub-dirs are
   # discovered. If you want to reach a Makefile.PL's in some remote
  
  
  



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

2001-10-11 Thread dougm

dougm   01/10/11 17:23:51

  Modified:lib/Apache Build.pm
  Log:
  fixup hpux cflags
  
  Revision  ChangesPath
  1.49  +16 -1 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Build.pm  2001/10/11 19:32:43 1.48
  +++ Build.pm  2001/10/12 00:23:50 1.49
  @@ -178,10 +178,25 @@
   $ccopts;
   }
   
  +sub ccopts_hpux {
  +my $cflags = shift;
  +#return if $Config{cc} eq 'gcc'; #XXX?
  +return if $$cflags =~ /(-Ae|\+e)/;
  +$$cflags .=  -Ae;
  +}
  +
   sub ccopts {
   my($self) = @_;
  +
  +my $cflags = $self-strip_lfs(ExtUtils::Embed::ccopts()) .
  +  $self-ap_ccopts;
  +
  +my $fixup = \{ccopts_$^O};
  +if (defined $fixup) {
  +$fixup-(\$cflags);
  +}
   
  -$self-strip_lfs(ExtUtils::Embed::ccopts()) . $self-ap_ccopts;
  +$cflags;
   }
   
   sub perl_config {
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-10 Thread dougm

dougm   01/10/09 10:58:44

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.35  +25 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- FunctionTable.pm  2001/10/08 17:58:16 1.34
  +++ FunctionTable.pm  2001/10/09 17:58:44 1.35
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Oct  8 11:03:58 2001
  +# !  Tue Oct  9 09:27:24 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -2755,6 +2755,30 @@
 {
   'type' = 'const char *',
   'name' = 'name'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_core_global_init',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_exit',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'status'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf .cvsignore extra.conf.in

2001-10-10 Thread stas

stas01/10/09 05:47:38

  Added:   ModPerl-Registry MANIFEST Makefile.PL README TODO
   ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm
RegistryBB.pm RegistryCooker.pm RegistryNG.pm
   ModPerl-Registry/t .cvsignore TEST.PL basic.t closure.t
   ModPerl-Registry/t/cgi-bin basic.pl closure.pl env.pl
local-conf.pl not_executable.pl require.pl
   ModPerl-Registry/t/conf .cvsignore extra.conf.in
  Log:
  - ModPerl::Registry and friends sub-project's basic functionality and
  tests
  
  Revision  ChangesPath
  1.1  modperl-2.0/ModPerl-Registry/MANIFEST
  
  Index: MANIFEST
  ===
  MANIFEST  This list of files
  Makefile.PL
  README
  TODO
  lib/ModPerl/PerlRun.pm
  lib/ModPerl/Registry.pm
  lib/ModPerl/RegistryBB.pm
  lib/ModPerl/RegistryCooker.pm
  lib/ModPerl/RegistryNG.pm
  t/TEST.PL
  t/basic.t
  t/closure.t
  t/cgi-bin/basic.pl
  t/cgi-bin/closure.pl
  t/cgi-bin/env.pl
  t/cgi-bin/local-conf.pl
  t/cgi-bin/not_executable.pl
  t/cgi-bin/require.pl
  t/conf/extra.conf.in
  t/htdocs/index.html
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/Makefile.PL
  
  Index: Makefile.PL
  ===
  require 5.6.1;
  
  use ExtUtils::MakeMaker;
  
  use lib qw(lib ../blib/lib);
  
  # enable 'make test|clean'
  use Apache::TestMM qw(test clean);
  
  # prerequisites
  my %require =
(
 Apache::Test = , # any version will do?
);
  
  my @scripts = qw(t/TEST);
  
  # accept the configs from comman line
  Apache::TestMM::filter_args();
  Apache::TestMM::generate_script('t/TEST');
  
  WriteMakefile
  (
   NAME = 'ModPerl::Registry',
   VERSION_FROM = 'lib/ModPerl/RegistryCooker.pm',
   PREREQ_PM= \%require,
   clean= {
FILES = @{ clean_files() },
   },
  );
  
  sub clean_files {
  return [@scripts];
  }
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/README
  
  Index: README
  ===
  to be written
  
  
  1.1  modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  - META tags in the modules
  
  ---
  
   - print STDERR is buffered in test handlers, whereas warn() works
 normally. select() helps, but STDERR should be unbuffered in first
 place.
  
  ---
  
   what's the replacement of NameWithVirtualHost? Obviously we need something
   to distinguish between vhs.
  
  DougM: well, if possible we should distinguish between the uri and
  requested resource instead.  in otherwords, we have the: r-uri =
  r-filename translation, just need to figure out if r-filename is the
  actual filename or a symlink (readlink can be used to get the real
  filename).  then create a package based on the filename, but with as
  few package:: levels as possible (hopefully none beyond
  ModPerl::RegistryROOT::filename)
  
  DougM: using filenames makes for long packages names == lengthy
  lookups and more memory than we need.  at least the way it is
  currently implemented where each '/' turns into '::'.  could be that
  s,/,_,g is good enough, but haven't thought about this for a while.
  in any case, we should get rid of the NameWithVirtualHost stuff, its
  caused too many problems in the past.
  
  ---
  
  Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
  http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
  Message-ID: [EMAIL PROTECTED]
  
  ---
  
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm
  
  Index: PerlRun.pm
  ===
  package ModPerl::PerlRun;
  
  use strict;
  use warnings FATAL = 'all';
  
  # we try to develop so we reload ourselves without die'ing on the warning
  no warnings qw(redefine); # XXX, this should go away in production!
  
  our $VERSION = '1.99';
  
  use ModPerl::RegistryCooker;
  @ModPerl::PerlRun::ISA = qw(ModPerl::RegistryCooker);
  
  # META: prototyping ($$) segfaults on request
  sub handler {
  my $class = (@_ = 2) ? shift : __PACKAGE__;
  my $r = shift;
  return $class-new($r)-default_handler();
  }
  
  my $parent = 'ModPerl::RegistryCooker';
  # the following code:
  # - specifies package's behavior different from default of $parent class
  # - speeds things up by shortcutting @ISA search, so even if the
  #   default is used we still use the alias
  my %aliases = (
   new = 'new',
   init= 'init',
   default_handler = 'default_handler',
   run = 'run',
   can_compile = 'can_compile

cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_perl.c modperl_perl.h

2001-10-10 Thread dougm

dougm   01/10/08 17:13:00

  Modified:src/modules/perl mod_perl.c modperl_perl.c modperl_perl.h
  Log:
  *CORE::GLOBAL::exit = \ModPerl::Util::exit
  
  Revision  ChangesPath
  1.88  +2 -0  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.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- mod_perl.c2001/10/07 19:04:20 1.87
  +++ mod_perl.c2001/10/09 00:13:00 1.88
  @@ -39,6 +39,8 @@
   
   modperl_env_default_populate(aTHX);
   
  +modperl_perl_core_global_init(aTHX);
  +
   for (i=0; MP_xs_loaders[i]; i++) {
   char *name = Perl_form(aTHX_ MP_xs_loader_name, MP_xs_loaders[i]);
   newCONSTSUB(PL_defstash, name, newSViv(1));
  
  
  
  1.5   +26 -0 modperl-2.0/src/modules/perl/modperl_perl.c
  
  Index: modperl_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_perl.c2001/09/16 17:28:43 1.4
  +++ modperl_perl.c2001/10/09 00:13:00 1.5
  @@ -4,6 +4,32 @@
* others (larger tweaks) are in their own modules, e.g. modperl_env.c
*/
   
  +typedef struct {
  +const char *name;
  +const char *sub_name;
  +const char *core_name;
  +} modperl_perl_core_global_t;
  +
  +#define MP_PERL_CORE_GLOBAL_ENT(name) \
  +{ name, ModPerl::Util:: name, CORE::GLOBAL:: name }
  +
  +static modperl_perl_core_global_t MP_perl_core_global_entries[] = {
  +MP_PERL_CORE_GLOBAL_ENT(exit),
  +{ NULL },
  +};
  +
  +void modperl_perl_core_global_init(pTHX)
  +{
  +modperl_perl_core_global_t *cglobals = MP_perl_core_global_entries;
  +
  +while (cglobals-name) {
  +GV *gv = gv_fetchpv(cglobals-core_name, TRUE, SVt_PVCV);
  +GvCV(gv) = get_cv(cglobals-sub_name, TRUE);
  +GvIMPORTED_CV_on(gv);
  +cglobals++;
  +}
  +}
  +
   void modperl_perl_ids_get(modperl_perl_ids_t *ids)
   {
   ids-pid  = (I32)getpid();
  
  
  
  1.5   +2 -0  modperl-2.0/src/modules/perl/modperl_perl.h
  
  Index: modperl_perl.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_perl.h2001/09/16 17:28:43 1.4
  +++ modperl_perl.h2001/10/09 00:13:00 1.5
  @@ -7,6 +7,8 @@
   Gid_t gid, egid;
   } modperl_perl_ids_t;
   
  +void modperl_perl_core_global_init(pTHX);
  +
   void modperl_perl_ids_get(modperl_perl_ids_t *ids);
   
   void modperl_perl_init_ids(pTHX_ modperl_perl_ids_t *ids);
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-10 Thread dougm

dougm   01/10/10 20:29:32

  Modified:.Makefile.PL
  Log:
  the DIR = [] patch does not work, backing it out for now.
  
  Revision  ChangesPath
  1.42  +1 -1  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Makefile.PL   2001/10/09 18:28:37 1.41
  +++ Makefile.PL   2001/10/11 03:29:32 1.42
  @@ -27,7 +27,7 @@
   ModPerl::MM::WriteMakefile(
   NAME = 'mod_perl',
   VERSION = $VERSION,
  -DIR = get_dirs_with_makefile(@remote_makefile_dirs),
  +#DIR = get_dirs_with_makefile(@remote_makefile_dirs),
   macro = {
   MODPERL_SRC   = $code-path,
   PERL  = $build-perl_config('perlpath'),
  
  
  



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

2001-10-09 Thread stas

stas01/10/09 01:32:46

  Added:   lib/Apache Reload.pm
  Log:
  - integrating Matt's Apache::Reload v0.07, as v0.08, so this version will
be found via CPAN.
  - changing the warnings setup to use warnings pragma instead of $^W
  
  Revision  ChangesPath
  1.1  modperl-2.0/lib/Apache/Reload.pm
  
  Index: Reload.pm
  ===
  package Apache::Reload;
  
  use strict;
  use warnings FATAL = 'all';
  
  our $VERSION = '0.08';
  
  use vars qw(%INCS %Stat $TouchTime %UndefFields);
  
  %Stat = ($INC{Apache/Reload.pm} = time);
  
  $TouchTime = time;
  
  sub import {
  my $class = shift;
  my($package,$file) = (caller)[0,1];
  
  $class-register_module($package, $file);
  }
  
  sub package_to_module {
  my $package = shift;
  $package =~ s/::/\//g;
  $package .= .pm;
  return $package;
  }
  
  sub register_module {
  my($class, $package, $file) = @_;
  my $module = package_to_module($package);
  
  if ($file) {
  $INCS{$module} = $file;
  }
  else {
  $file = $INC{$module};
  return unless $file;
  $INCS{$module} = $file;
  }
  
  no strict 'refs';
  if (%{${package}::FIELDS}) {
  $UndefFields{$module} = ${package}::FIELDS;
  }
  }
  
  sub handler {
  my $r = shift;
  
  my $DEBUG = ref($r)  (lc($r-dir_config(ReloadDebug) || '') eq 'on');
  
  my $TouchFile = ref($r)  $r-dir_config(ReloadTouchFile);
  
  my $TouchModules;
  
  if ($TouchFile) {
  warn Checking mtime of $TouchFile\n if $DEBUG;
  my $touch_mtime = (stat($TouchFile))[9] || return 1;
  return 1 unless $touch_mtime  $TouchTime;
  $TouchTime = $touch_mtime;
  my $sym = Apache-gensym;
  open($sym, $TouchFile) || die Can't open '$TouchFile': $!;
  $TouchModules = $sym;
  chomp $TouchModules;
  }
  
  if (ref($r)  (lc($r-dir_config(ReloadAll) || 'on') eq 'on')) {
  *Apache::Reload::INCS = \%INC;
  }
  else {
  *Apache::Reload::INCS = \%INCS;
  my $ExtraList = 
  $TouchModules || 
  (ref($r)  $r-dir_config(ReloadModules)) || 
  '';
  my @extra = split(/\s+/, $ExtraList);
  foreach (@extra) {
  if (/(.*)::\*$/) {
  my $prefix = $1;
  $prefix =~ s/::/\//g;
  foreach my $match (keys %INC) {
  if ($match =~ /^\Q$prefix\E/) {
  $Apache::Reload::INCS{$match} = $INC{$match};
  my $package = $match;
  $package =~ s/\//::/g;
  $package =~ s/\.pm$//;
  no strict 'refs';
  #warn checking for FIELDS on $package\n;
  if (%{${package}::FIELDS}) {
  #warn found fields in $package\n;
  $UndefFields{$match} = ${package}::FIELDS;
  }
  }
  }
  }
  else {
  Apache::Reload-register_module($_);
  }
  }
  }
  
  while (my($key, $file) = each %Apache::Reload::INCS) {
  warn Apache::Reload: Checking mtime of $key\n if $DEBUG;
  
  my $mtime = (stat $file)[9];
  
  unless (defined($mtime)  $mtime) {
  for (@INC) {
  $mtime = (stat $_/$file)[9];
  last if defined($mtime)  $mtime;
  }
  }
  
  warn(Apache::Reload: Can't locate $file\n),next 
  unless defined $mtime and $mtime;
  
  unless (defined $Stat{$file}) {
  $Stat{$file} = $^T;
  }
  
  if ($mtime  $Stat{$file}) {
  delete $INC{$key};
  #   warn Reloading $key\n;
  if (my $symref = $UndefFields{$key}) {
  #warn undeffing fields\n;
  no strict 'refs';
  undef %{$symref};
  }
  no warnings FATAL = 'all';
  require $key;
  warn(Apache::Reload: process $$ reloading $key\n)
  if $DEBUG;
  }
  $Stat{$file} = $mtime;
  }
  
  return 1;
  }
  
  1;
  __END__
  
  =head1 NAME
  
  Apache::Reload - Reload changed modules
  
  =head1 SYNOPSIS
  
  In httpd.conf:
  
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
  
  Then your module:
  
package My::Apache::Module;
  
use Apache::Reload;

sub handler { ... }

1;
  
  =head1 DESCRIPTION
  
  This module is two things. First it is an adaptation of Randal
  Schwartz's Stonehenge::Reload module that attempts to be a little 
  more intuitive and makes the usage easier. Stonehenge::Reload was
  written by Randal to make

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

2001-10-09 Thread dougm

dougm   01/10/08 22:42:49

  Modified:lib/Apache compat.pm
  Log:
  use __FILE__ instead of 1 for dummy %INC values
  
  Revision  ChangesPath
  1.22  +2 -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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- compat.pm 2001/10/08 23:51:21 1.21
  +++ compat.pm 2001/10/09 05:42:49 1.22
  @@ -28,9 +28,9 @@
   use mod_perl ();
   
   BEGIN {
  -$INC{'Apache.pm'} = 1;
  +$INC{'Apache.pm'} = __FILE__;
   
  -$INC{'Apache/Constants.pm'} = 1;
  +$INC{'Apache/Constants.pm'} = __FILE__;
   }
   
   package Apache;
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t closure.t

2001-10-09 Thread stas

stas01/10/09 09:48:31

  Modified:ModPerl-Registry/t closure.t
  Log:
  - using select() instead of sleep to gain 1 sec delay granularity, needed
  for -M to notice that the file was modified
  
  Revision  ChangesPath
  1.2   +4 -1  modperl-2.0/ModPerl-Registry/t/closure.t
  
  Index: closure.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/closure.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- closure.t 2001/10/09 12:47:38 1.1
  +++ closure.t 2001/10/09 16:48:31 1.2
  @@ -119,7 +119,10 @@
   
   sub sleep_and_touch_file {
   my $file = shift;
  -sleep 2; # so -M will be different, res: 1 sec, granularity  1sec
  +# need to wait at least 1 whole sec, so -M will notice the
  +# difference. select() has better resolution than 1 sec as in
  +# sleep()
  +select undef, undef, undef, 1.00; # sure 1 sec
   my $now = time;
   utime $now, $now, $file;
   }
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2001-10-09 Thread dougm

dougm   01/10/09 11:28:37

  Modified:.Makefile.PL
  Log:
  clean xs/*.def and xs/*.exp
  
  Revision  ChangesPath
  1.41  +1 -0  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Makefile.PL   2001/10/04 10:51:46 1.40
  +++ Makefile.PL   2001/10/09 18:28:37 1.41
  @@ -140,6 +140,7 @@
   my $path = $code-path;
   
   return [@{ $build-clean_files }, @scripts,
  +xs/*.exp, xs/*.def,
 map { $path/$_} @{ $code-clean_files }];
   }
   
  
  
  



Re: cvs commit: modperl-2.0/xs/ModPerl/Util ModPerl__Util.h

2001-10-09 Thread Stas Bekman

[EMAIL PROTECTED] wrote:

 dougm   01/10/08 10:57:45
 
   Added:   xs/ModPerl/Util ModPerl__Util.h
   Log:
   new module for util functions
   
   Revision  ChangesPath
   1.1  modperl-2.0/xs/ModPerl/Util/ModPerl__Util.h
   
   Index: ModPerl__Util.h
   ===
   static MP_INLINE void mpxs_ModPerl__Util_untaint(pTHX_ I32 items,
SV **MARK, SV **SP)
   {
   while (MARK = SP) {
   SvTAINTED_off(*MARK++);
   }
   }


This hangs in Apache::Registry tests, MARK never gets incremented.

This patch fixes things. But I'm interested to know why yours doesn't work?


Index: xs/ModPerl/Util/ModPerl__Util.h
===
RCS file: /home/cvs/modperl-2.0/xs/ModPerl/Util/ModPerl__Util.h,v
retrieving revision 1.2
diff -u -r1.2 ModPerl__Util.h
--- xs/ModPerl/Util/ModPerl__Util.h 2001/10/08 23:44:17 1.2
+++ xs/ModPerl/Util/ModPerl__Util.h 2001/10/09 04:04:56
@@ -2,7 +2,8 @@
   SV **MARK, SV **SP)
  {
  while (MARK = SP) {
-SvTAINTED_off(*MARK++);
+SvTAINTED_off(*MARK);
+MARK++; // cannot ++ while in SvTAINTED_off
  }
  }


-- 


_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm

2001-10-08 Thread dougm

dougm   01/10/08 10:04:46

  Modified:lib/ModPerl WrapXS.pm
  Log:
  default to Apache::XSLoader if class does not have its own (e.g. ModPerl::)
  
  Revision  ChangesPath
  1.24  +3 -0  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- WrapXS.pm 2001/10/07 22:39:09 1.23
  +++ WrapXS.pm 2001/10/08 17:04:46 1.24
  @@ -483,6 +483,9 @@
   }
   
   my $base   = (split '::', $module)[0];
  +unless (-e lib/$base/XSLoader.pm) {
  +$base = 'Apache';
  +}
   my $loader = join '::', $base, 'XSLoader';
   
   my $fh = $self-open_class_file($module, '.pm');
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-08 Thread dougm

dougm   01/10/08 10:39:54

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.33  +10 -2 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- FunctionTable.pm  2001/10/07 23:02:41 1.32
  +++ FunctionTable.pm  2001/10/08 17:39:54 1.33
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Sun Oct  7 15:51:20 2001
  +# !  Mon Oct  8 10:46:14 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -4712,8 +4712,16 @@
   'name' = 'mpxs_special_list_do',
   'args' = [
 {
  -'type' = '',
  +'type' = 'PerlInterpreter *',
   'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'name'
  +  },
  +  {
  +'type' = 'SV *',
  +'name' = 'package'
 },
 {
   'type' = 'mpxs_special_list_do_t',
  
  
  



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

2001-10-08 Thread dougm

dougm   01/10/08 16:34:07

  Modified:src/modules/perl modperl_util.c modperl_util.h
  Log:
  add modperl_perl_exit() function
  
  Revision  ChangesPath
  1.25  +8 -0  modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_util.c2001/10/07 20:24:21 1.24
  +++ modperl_util.c2001/10/08 23:34:07 1.25
  @@ -422,6 +422,14 @@
   }
   }
   
  +void modperl_perl_exit(pTHX_ int status)
  +{
  +ENTER;
  +SAVESPTR(PL_diehook);
  +PL_diehook = Nullsv; 
  +Perl_croak(aTHX_ NULL);
  +}
  +
   MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
char *key, SV *sv_val)
   {
  
  
  
  1.24  +2 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- modperl_util.h2001/10/07 20:24:21 1.23
  +++ modperl_util.h2001/10/08 23:34:07 1.24
  @@ -70,6 +70,8 @@
   
   void modperl_perl_call_list(pTHX_ AV *subs, const char *name);
   
  +void modperl_perl_exit(pTHX_ int status);
  +
   MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
char *key, SV *sv_val);
   
  
  
  



cvs commit: modperl-2.0/xs/ModPerl/Util - New directory

2001-10-08 Thread dougm

dougm   01/10/08 10:57:28

  modperl-2.0/xs/ModPerl/Util - New directory



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-08 Thread dougm

dougm   01/10/08 10:58:17

  Modified:lib/Apache compat.pm
   xs/maps  modperl_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  integrate ModPerl::Util and add Apache::untaint compat functionality
  
  Revision  ChangesPath
  1.19  +3 -0  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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- compat.pm 2001/10/08 17:33:02 1.18
  +++ compat.pm 2001/10/08 17:58:16 1.19
  @@ -40,6 +40,9 @@
   }
   
   sub untaint {
  +shift;
  +require ModPerl::Util;
  +ModPerl::Util::untaint(@_);
   }
   
   sub module {
  
  
  
  1.22  +3 -0  modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- modperl_functions.map 2001/10/07 23:02:41 1.21
  +++ modperl_functions.map 2001/10/08 17:58:16 1.22
  @@ -1,5 +1,8 @@
   #modperl specfic functions
   
  +MODULE=ModPerl::Util
  + mpxs_ModPerl__Util_untaint | | ...
  +
   MODULE=ModPerl::Global
mpxs_ModPerl__Global_special_list_call
mpxs_ModPerl__Global_special_list_clear
  
  
  
  1.34  +23 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- FunctionTable.pm  2001/10/08 17:39:54 1.33
  +++ FunctionTable.pm  2001/10/08 17:58:16 1.34
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Oct  8 10:46:14 2001
  +# !  Mon Oct  8 11:03:58 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -4192,6 +4192,28 @@
 {
   'type' = 'SV *',
   'name' = 'package'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'mpxs_ModPerl__Util_untaint',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'items'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'mark'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sp'
 }
   ]
 },
  
  
  



cvs commit: modperl-2.0/todo api.txt

2001-10-08 Thread dougm

dougm   01/10/08 11:41:10

  Modified:todo api.txt
  Log:
  2.0 has removed r-content_language
  
  Revision  ChangesPath
  1.10  +0 -4  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- api.txt   2001/10/08 18:40:34 1.9
  +++ api.txt   2001/10/08 18:41:10 1.10
  @@ -112,10 +112,6 @@
   Apache-unescape_url{_info}:
   not yet implemented.  should be moved to Apache::Util
   
  -$r-content_language:
  -deprecate in favor of $r-content_languages?
  -would require that apache-2.0 is also rid of r-content_language usage
  -
   apr_array_header_t:
   needs an interface, either methods and/or tied array interface
   
  
  
  



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

2001-10-08 Thread dougm

dougm   01/10/08 13:36:47

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



cvs commit: modperl-2.0/xs/maps apache_functions.map apr_functions.map

2001-10-07 Thread dougm

dougm   01/10/07 12:22:49

  Modified:lib/ModPerl TypeMap.pm
   xs/Apache/Filter Apache__Filter.h
   xs/maps  apache_functions.map apr_functions.map
  Log:
  remove ModPerl::TypeMap::first_class guessing based on return_type
  
  Revision  ChangesPath
  1.11  +0 -2  modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TypeMap.pm2001/09/15 18:17:31 1.10
  +++ TypeMap.pm2001/10/07 19:22:49 1.11
  @@ -266,8 +266,6 @@
   sub first_class {
   my($self, $func) = @_;
   
  -return $func-{return_type} if $func-{return_type} =~ /::/;
  -
   for my $e (@{ $func-{args} }) {
   next unless $e-{type} =~ /::/;
   #there are alot of util functions that take an APR::Pool
  
  
  
  1.15  +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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Apache__Filter.h  2001/08/30 01:08:24 1.14
  +++ Apache__Filter.h  2001/10/07 19:22:49 1.15
  @@ -1,6 +1,9 @@
   #define mpxs_Apache__RequestRec_add_output_filter(r, name, ctx) \
   ap_add_output_filter(name, ctx, r, NULL)
   
  +#define mpxs_Apache__RequestRec_add_input_filter(r, name, ctx) \
  +ap_add_output_filter(name, ctx, r, NULL)
  +
   #define mp_xs_sv2_modperl_filter(sv) \
   ((SvROK(sv)  (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
   || (Perl_croak(aTHX_ argument is not a blessed reference),0) ? \
  
  
  
  1.32  +3 -1  modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- apache_functions.map  2001/10/06 01:03:27 1.31
  +++ apache_functions.map  2001/10/07 19:22:49 1.32
  @@ -193,10 +193,12 @@
   MODULE=Apache::Filter PACKAGE=Apache::RequestRec
   ap_filter_t *:DEFINE_add_output_filter | | \
 request_rec *:r, const char *:name, void *:ctx
  +ap_filter_t *:DEFINE_add_input_filter | | \
  +  request_rec *:r, const char *:name, void *:ctx
   
   PACKAGE=guess
   ~ap_add_output_filter
  - ap_add_input_filter
  +~ap_add_input_filter
ap_get_brigade | mpxs_ | \
  filter, bucket, mode=AP_MODE_NONBLOCKING, SV *:readbytes=Nullsv
ap_pass_brigade
  
  
  
  1.24  +1 -1  modperl-2.0/xs/maps/apr_functions.map
  
  Index: apr_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- apr_functions.map 2001/09/28 17:20:32 1.23
  +++ apr_functions.map 2001/10/07 19:22:49 1.24
  @@ -454,7 +454,7 @@
apr_getnameinfo
   -apr_getservbyname
apr_parse_addr_port
  -PACKAGE=guess
  +PACKAGE=APR::IpSubnet
apr_ipsubnet_t *:apr_ipsubnet_create | mpxs_ | \
 SV *:CLASS, p, ipstr, mask_or_numbits=NULL | new
apr_ipsubnet_test
  
  
  



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

2001-10-07 Thread dougm

dougm   01/10/07 13:20:53

  Modified:src/modules/perl modperl_util.c
  Log:
  style nits
  
  Revision  ChangesPath
  1.22  +20 -17modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- modperl_util.c2001/10/06 23:27:35 1.21
  +++ modperl_util.c2001/10/07 20:20:53 1.22
  @@ -399,51 +399,54 @@
   }
   }
   
  -MP_INLINE
  -SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
  -   char *key, SV *sv_val)
  +MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
  + char *key, SV *sv_val)
   {
  -SV *RETVAL = PL_sv_undef;
  +SV *retval = PL_sv_undef;
   
   if (r  r-per_dir_config) {   
   MP_dDCFG;
  -RETVAL = modperl_table_get_set(aTHX_ dcfg-SetVar, key, sv_val, FALSE);
  +retval = modperl_table_get_set(aTHX_ dcfg-SetVar,
  +   key, sv_val, FALSE);
   }
   
  -if (!SvTRUE(RETVAL)) {
  +if (!SvTRUE(retval)) {
   if (s  s-module_config) {
   MP_dSCFG(s);
  -SvREFCNT_dec(RETVAL); /* in case above did newSV(0) */
  -RETVAL = modperl_table_get_set(aTHX_ scfg-SetVar, key, sv_val, FALSE);
  -} else {
  -RETVAL = PL_sv_undef;
  +SvREFCNT_dec(retval); /* in case above did newSV(0) */
  +retval = modperl_table_get_set(aTHX_ scfg-SetVar,
  +   key, sv_val, FALSE);
   }
  +else {
  +retval = PL_sv_undef;
  +}
   }
   
  -return RETVAL;
  +return retval;
   }
   
   SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key,
 SV *sv_val, bool do_taint)
   {
  -SV *RETVAL = PL_sv_undef;
  +SV *retval = PL_sv_undef;
   
   if (table == NULL) { 
   /* do nothing */
   }
   else if (key == NULL) { 
  -RETVAL = modperl_hash_tie(aTHX_ APR::Table, Nullsv, (void*)table); 
  +retval = modperl_hash_tie(aTHX_ APR::Table,
  +  Nullsv, (void*)table); 
   }
   else if (sv_val == PL_sv_no) { /* no val was passed */
   char *val; 
   if ((val = (char *)apr_table_get(table, key))) { 
  -RETVAL = newSVpv(val, 0); 
  +retval = newSVpv(val, 0); 
   } 
   else { 
  -RETVAL = newSV(0); 
  +retval = newSV(0); 
   } 
   if (do_taint) { 
  -SvTAINTED_on(RETVAL); 
  +SvTAINTED_on(retval); 
   } 
   }
   else if (sv_val == PL_sv_undef) { /* val was passed in as undef */
  @@ -453,7 +456,7 @@
   apr_table_set(table, key, SvPV_nolen(sv_val));
   } 
   
  -return RETVAL;
  +return retval;
   }
   
   MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name)
  
  
  



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

2001-10-07 Thread dougm

dougm   01/10/07 13:22:02

  Modified:src/modules/perl modperl_util.c modperl_util.h
  Log:
  s/bool/int/ (i dont think bool is portable)
  
  Revision  ChangesPath
  1.23  +1 -1  modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- modperl_util.c2001/10/07 20:20:53 1.22
  +++ modperl_util.c2001/10/07 20:22:02 1.23
  @@ -426,7 +426,7 @@
   }
   
   SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key,
  -  SV *sv_val, bool do_taint)
  +  SV *sv_val, int do_taint)
   {
   SV *retval = PL_sv_undef;
   
  
  
  
  1.22  +1 -1  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- modperl_util.h2001/10/06 23:27:35 1.21
  +++ modperl_util.h2001/10/07 20:22:02 1.22
  @@ -72,7 +72,7 @@
char *key, SV *sv_val);
   
   SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key,
  -  SV *sv_val, bool do_taint);
  +  SV *sv_val, int do_taint);
   
   MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name);
   
  
  
  



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

2001-10-07 Thread dougm

dougm   01/10/07 13:24:22

  Modified:src/modules/perl modperl_util.c modperl_util.h
  Log:
  add modperl_perl_call_list() function
  
  Revision  ChangesPath
  1.24  +23 -0 modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- modperl_util.c2001/10/07 20:22:02 1.23
  +++ modperl_util.c2001/10/07 20:24:21 1.24
  @@ -399,6 +399,29 @@
   }
   }
   
  +void modperl_perl_call_list(pTHX_ AV *subs, const char *name)
  +{
  +I32 i, oldscope = PL_scopestack_ix;
  +SV **ary = AvARRAY(subs);
  +
  +for (i=0; i=AvFILLp(subs); i++) {
  + CV *cv = (CV*)ary[i];
  + SV *atsv = ERRSV;
  +
  + PUSHMARK(PL_stack_sp);
  + call_sv((SV*)cv, G_EVAL|G_DISCARD);
  +
  + if (SvCUR(atsv)) {
  +Perl_sv_catpvf(aTHX_ atsv, %s failed--call queue aborted,
  +   name);
  + while (PL_scopestack_ix  oldscope) {
  + LEAVE;
  +}
  +Perl_croak(aTHX_ %s, SvPVX(atsv));
  + }
  +}
  +}
  +
   MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
char *key, SV *sv_val)
   {
  
  
  
  1.23  +2 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- modperl_util.h2001/10/07 20:22:02 1.22
  +++ modperl_util.h2001/10/07 20:24:21 1.23
  @@ -68,6 +68,8 @@
   
   MP_INLINE void modperl_perl_av_push_elts_ref(pTHX_ AV *dst, AV *src);
   
  +void modperl_perl_call_list(pTHX_ AV *subs, const char *name);
  +
   MP_INLINE SV *modperl_dir_config(pTHX_ request_rec *r, server_rec *s,
char *key, SV *sv_val);
   
  
  
  



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

2001-10-07 Thread dougm

dougm   01/10/07 14:59:16

  Modified:src/modules/perl modperl_perl_global.c modperl_perl_global.h
  Log:
  implement logic for saving Perl special subroutines (END,BEGIN,CHECK,INIT)
  into the per-interpreter PL_modglobal hash
  
  modperl_perl_global_avcv_call() function to call the subroutines for given
  package
  
  modperl_perl_global_avcv_clear() function to clear the subroutines for given
  package
  
  END blocks are now saved via the new logic
  
  Revision  ChangesPath
  1.6   +130 -0modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_perl_global.c 2001/10/07 19:04:20 1.5
  +++ modperl_perl_global.c 2001/10/07 21:59:16 1.6
  @@ -6,9 +6,131 @@
   globals-inc.gv= PL_incgv;
   globals-defout.gv = PL_defoutgv;
   globals-rs.sv = PL_rs;
  +globals-end.av= PL_endav;
  +globals-end.key   = MP_MODGLOBAL_END;
   }
   
  +/* XXX: PL_modglobal thingers might be useful elsewhere */
  +
  +#define MP_MODGLOBAL_ENT(key) \
  +{key, ModPerl:: key, (sizeof(ModPerl::)-1)+(sizeof(key)-1), 0}
  +
  +static modperl_modglobal_key_t MP_modglobal_keys[] = {
  +MP_MODGLOBAL_ENT(END),
  +};
  +
  +static AV *modperl_perl_global_avcv_fetch(pTHX_ modperl_modglobal_key_t *gkey,
  +  const char *package, I32 packlen)
  +{
  +SV **svp = hv_fetch(PL_modglobal, gkey-val, gkey-len, FALSE);
  +HV *hv;
  +
  +if (!(svp  (hv = (HV*)*svp))) {
  +return Nullav;
  +}
  +
  +if (!(svp = hv_fetch(hv, package, packlen, FALSE))) {
  +return Nullav;
  +}
  +
  +return (AV*)*svp;
  +}
  +
  +void modperl_perl_global_avcv_call(pTHX_ modperl_modglobal_key_t *gkey,
  +   const char *package, I32 packlen)
  +{
  +AV *av = modperl_perl_global_avcv_fetch(aTHX_ gkey, package, packlen);
  +
  +if (!av) {
  +return;
  +}
  +
  +modperl_perl_call_list(aTHX_ av, gkey-name);
  +}
  +
  +void modperl_perl_global_avcv_clear(pTHX_ modperl_modglobal_key_t *gkey,
  +const char *package, I32 packlen)
  +{
  +AV *av = modperl_perl_global_avcv_fetch(aTHX_ gkey, package, packlen);
  +
  +if (!av) {
  +return;
  +}
  +
  +av_clear(av);
  +}
  +
  +static int modperl_perl_global_avcv_set(pTHX_ SV *sv, MAGIC *mg)
  +{
  +HV *hv;
  +AV *mav, *av = (AV*)sv;
  +const char *package = HvNAME(PL_curstash);
  +I32 packlen = strlen(package);
  +modperl_modglobal_key_t *gkey =
  +(modperl_modglobal_key_t *)mg-mg_ptr;
  +
  +hv = (HV*)*hv_fetch(PL_modglobal, gkey-val, gkey-len, TRUE);
  +(void)SvUPGRADE((SV*)hv, SVt_PVHV);
  +
  +mav = (AV*)*hv_fetch(hv, package, packlen, TRUE);
  +(void)SvUPGRADE((SV*)mav, SVt_PVAV);
  +
  +/* $cv = pop @av */
  +sv = AvARRAY(av)[AvFILLp(av)];
  +AvARRAY(av)[AvFILLp(av)--] = PL_sv_undef;
  +
  +/* push @{ $PL_modglobal{$key}{$package} }, $cv */
  +av_store(mav, AvFILLp(av)+1, sv);
  +
  +return 1;
  +}
  +
  +static MGVTBL modperl_vtbl_global_avcv_t = {
  +0,
  +MEMBER_TO_FPTR(modperl_perl_global_avcv_set),
  +0, 0, 0,
  +};
  +
  +/* XXX: Apache::RegistryLoader type things need access to this
  + * for compiling scripts at startup
  + */
  +static void modperl_perl_global_avcv_tie(pTHX_ modperl_modglobal_key_e key,
  + AV *av)
  +{
  +if (!SvMAGIC((SV*)av)) {
  +MAGIC *mg;
  +Newz(702, mg, 1, MAGIC);
  +mg-mg_virtual = modperl_vtbl_global_avcv_t;
  +mg-mg_ptr = (char *)MP_modglobal_keys[key];
  +mg-mg_len = -1; /* prevent free() of mg-mg_ptr */
  +SvMAGIC((SV*)av) = mg;
  +}
  +
  +SvSMAGICAL_on((SV*)av);
  +}
  +
  +static void modperl_perl_global_avcv_untie(pTHX_ AV *av)
  +{
  +SvSMAGICAL_off((SV*)av);
  +}
  +
  +static void
  +modperl_perl_global_avcv_save(pTHX_ modperl_perl_global_avcv_t *avcv)
  +{
  +avcv-origav = *avcv-av;
  +*avcv-av = newAV(); /* XXX: only need 1 of these AVs per-interpreter */
  +modperl_perl_global_avcv_tie(aTHX_ avcv-key, *avcv-av);
  +}
  +
   static void
  +modperl_perl_global_avcv_restore(pTHX_ modperl_perl_global_avcv_t *avcv)
  +{
  +modperl_perl_global_avcv_untie(aTHX_ *avcv-av);
  +SvREFCNT_dec(*avcv-av); /* XXX: see XXX above */
  +*avcv-av = avcv-origav;
  +}
  +
  +static void
   modperl_perl_global_gvhv_save(pTHX_ modperl_perl_global_gvhv_t *gvhv)
   {
   U32 mg_flags;
  @@ -93,6 +215,7 @@
   }
   
   typedef enum {
  +MP_GLOBAL_AVCV,
   MP_GLOBAL_GVHV,
   MP_GLOBAL_GVAV,
   MP_GLOBAL_GVIO,
  @@ -109,6 +232,7 @@
   STRUCT_OFFSET

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

2001-10-07 Thread dougm

dougm   01/10/07 15:04:07

  Modified:src/modules/perl modperl_perl_global.c modperl_perl_global.h
  Log:
  add modperl_modglobal_lookup() function to lookup a modperl_modglobal_key_t based on 
string name
  
  Revision  ChangesPath
  1.7   +14 -0 modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_perl_global.c 2001/10/07 21:59:16 1.6
  +++ modperl_perl_global.c 2001/10/07 22:04:07 1.7
  @@ -17,7 +17,21 @@
   
   static modperl_modglobal_key_t MP_modglobal_keys[] = {
   MP_MODGLOBAL_ENT(END),
  +{ NULL },
   };
  +
  +modperl_modglobal_key_t *modperl_modglobal_lookup(pTHX_ const char *name)
  +{
  +int i;
  +
  +for (i=0; MP_modglobal_keys[i].name; i++) {
  +if (strEQ(MP_modglobal_keys[i].name, name)) {
  +return MP_modglobal_keys[i];
  +}
  +}
  +
  +return NULL;
  +}
   
   static AV *modperl_perl_global_avcv_fetch(pTHX_ modperl_modglobal_key_t *gkey,
 const char *package, I32 packlen)
  
  
  
  1.6   +2 -0  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_perl_global.h 2001/10/07 21:59:16 1.5
  +++ modperl_perl_global.h 2001/10/07 22:04:07 1.6
  @@ -49,6 +49,8 @@
   modperl_perl_global_svpv_t rs;
   } modperl_perl_globals_t;
   
  +modperl_modglobal_key_t *modperl_modglobal_lookup(pTHX_ const char *name);
  +
   void modperl_perl_global_request_save(pTHX_ request_rec *r);
   
   void modperl_perl_global_request_restore(pTHX_ request_rec *r);
  
  
  



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

2001-10-07 Thread dougm

dougm   01/10/07 15:07:15

  Modified:src/modules/perl modperl_perl_global.c modperl_perl_global.h
  Log:
  wont be able to use a precomputed hash for modperl_modglobal_key_t's
  
  Revision  ChangesPath
  1.8   +1 -1  modperl-2.0/src/modules/perl/modperl_perl_global.c
  
  Index: modperl_perl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl_global.c 2001/10/07 22:04:07 1.7
  +++ modperl_perl_global.c 2001/10/07 22:07:15 1.8
  @@ -13,7 +13,7 @@
   /* XXX: PL_modglobal thingers might be useful elsewhere */
   
   #define MP_MODGLOBAL_ENT(key) \
  -{key, ModPerl:: key, (sizeof(ModPerl::)-1)+(sizeof(key)-1), 0}
  +{key, ModPerl:: key, (sizeof(ModPerl::)-1)+(sizeof(key)-1)}
   
   static modperl_modglobal_key_t MP_modglobal_keys[] = {
   MP_MODGLOBAL_ENT(END),
  
  
  
  1.7   +0 -1  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_perl_global.h 2001/10/07 22:04:07 1.6
  +++ modperl_perl_global.h 2001/10/07 22:07:15 1.7
  @@ -5,7 +5,6 @@
   const char *name;
   const char *val;
   I32 len;
  -U32 hash;
   } modperl_modglobal_key_t;
   
   typedef enum {
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2001-10-07 Thread dougm

dougm   01/10/07 15:11:56

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.31  +124 -8modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- FunctionTable.pm  2001/10/06 01:03:27 1.30
  +++ FunctionTable.pm  2001/10/07 22:11:56 1.31
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Fri Oct  5 17:52:47 2001
  +# !  Sun Oct  7 15:18:16 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -122,6 +122,10 @@
   'name' = 'p'
 },
 {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  },
  +  {
   'type' = 'server_rec *',
   'name' = 's'
 },
  @@ -433,6 +437,24 @@
 },
 {
   'return_type' = 'const char *',
  +'name' = 'modperl_cmd_init_handlers',
  +'args' = [
  +  {
  +'type' = 'cmd_parms *',
  +'name' = 'parms'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'mconfig'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'arg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'const char *',
   'name' = 'modperl_cmd_input_filter_handlers',
   'args' = [
 {
  @@ -2513,6 +2535,20 @@
   ]
 },
 {
  +'return_type' = 'modperl_modglobal_key_t *',
  +'name' = 'modperl_modglobal_lookup',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'name'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'SV *',
   'name' = 'modperl_newSVsv_obj',
   'args' = [
  @@ -2688,34 +2724,114 @@
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_perl_global_restore',
  +'name' = 'modperl_perl_av_push_elts_ref',
   'args' = [
 {
   'type' = 'PerlInterpreter *',
   'name' = 'my_perl'
 },
 {
  -'type' = 'modperl_perl_globals_t *',
  -'name' = 'globals'
  +'type' = 'AV *',
  +'name' = 'dst'
  +  },
  +  {
  +'type' = 'AV *',
  +'name' = 'src'
 }
   ]
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_perl_global_save',
  +'name' = 'modperl_perl_call_list',
   'args' = [
 {
   'type' = 'PerlInterpreter *',
   'name' = 'my_perl'
 },
  +  {
  +'type' = 'AV *',
  +'name' = 'subs'
  +  },
 {
  -'type' = 'modperl_perl_globals_t *',
  -'name' = 'globals'
  +'type' = 'const char *',
  +'name' = 'name'
 }
   ]
 },
 {
   'return_type' = 'void',
  +'name' = 'modperl_perl_global_avcv_call',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'modperl_modglobal_key_t *',
  +'name' = 'gkey'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'package'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'packlen'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_global_avcv_clear',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'modperl_modglobal_key_t *',
  +'name' = 'gkey'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'package'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'packlen'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_global_request_restore',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
  +'name' = 'modperl_perl_global_request_save',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
   'name' = 'modperl_perl_ids_get',
   'args' = [
 {
  @@ -3068,7 +3184,7 @@
   'name' = 'sv_val'
 },
 {
  -'type' = 'char',
  +'type' = 'int',
   'name' = 'do_taint'
 }
   ]
  
  
  



<    1   2   3   4   5   6   7   8   9   10   >