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

2002-01-07 Thread dougm

dougm   02/01/07 17:29:23

  Modified:src/modules/perl modperl_util.c
  Log:
  plug leaking Apache::Table objects
  
  Revision  ChangesPath
  1.33  +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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- modperl_util.c14 Dec 2001 04:35:28 -  1.32
  +++ modperl_util.c8 Jan 2002 01:29:23 -   1.33
  @@ -367,7 +367,7 @@
  SV *tsv, void *p)
   {
   SV *hv = (SV*)newHV();
  -SV *rsv = newSViv(0);
  +SV *rsv = sv_newmortal();
   
   sv_setref_pv(rsv, classname, p);
   sv_magic(hv, rsv, PERL_MAGIC_tied, Nullch, 0);
  
  
  



cvs commit: modperl-2.0/xs/Apache/Response Apache__Response.h

2002-01-06 Thread dougm

dougm   02/01/06 14:23:24

  Modified:xs/Apache/Response Apache__Response.h
  Log:
  rcfg-wbucket is now a pointer
  
  Revision  ChangesPath
  1.5   +2 -2  modperl-2.0/xs/Apache/Response/Apache__Response.h
  
  Index: Apache__Response.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Apache__Response.h13 Sep 2001 04:41:44 -  1.4
  +++ Apache__Response.h6 Jan 2002 22:23:24 -   1.5
  @@ -10,7 +10,7 @@
   STRLEN len; \
   const char *bodytext; \
   modperl_cgi_header_parse(r, SvPV(sv,len), bodytext); \
  -rcfg-wbucket.header_parse = 0; \
  +rcfg-wbucket-header_parse = 0; \
   }
   
   /* XXX: should only be part of Apache::compat */
  @@ -23,5 +23,5 @@
   r-content_type = apr_pstrdup(r-pool, type);
   }
   
  -rcfg-wbucket.header_parse = 0; /* turn off PerlOptions +ParseHeaders */
  +rcfg-wbucket-header_parse = 0; /* turn off PerlOptions +ParseHeaders */
   }
  
  
  



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

2001-12-22 Thread dougm

dougm   01/12/22 21:46:29

  Modified:src/modules/perl mod_perl.c modperl_perl_includes.h
  Log:
  nasty workaround for bug fixed in bleedperl (11536 + 11553) in
  $foo = \*STDOUT; where the reference would get a copy of STDOUT
  without the tie magic.
  
  (recentish changes that re-tied STDOUT every request uncovered an
  instance of the bug during 'make test')
  
  Revision  ChangesPath
  1.100 +55 -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.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- mod_perl.c2001/12/11 23:20:34 1.99
  +++ mod_perl.c2001/12/23 05:46:29 1.100
  @@ -42,12 +42,67 @@
   apr_pool_t *p = MP_boot_data.p; \
   server_rec *s = MP_boot_data.s
   
  +#if defined(USE_ITHREADS)  defined(MP_PERL_5_6_1)
  +#   define MP_REFGEN_FIXUP
  +#endif
  +
  +#ifdef MP_REFGEN_FIXUP
  +
  +/*
  + * nasty workaround for bug fixed in bleedperl (11536 + 11553)
  + * XXX: when 5.8.0 is released + stable, we will require 5.8.0
  + * if ithreads are enabled.
  + */
  +static OP * (*MP_pp_srefgen_ptr)(pTHX) = NULL;
  +
  +static OP *modperl_pp_srefgen(pTHX)
  +{
  +dSP;
  +OP *o;
  +SV *sv = *SP;
  +
  +if (SvPADTMP(sv)  IS_PADGV(sv)) {
  +/* prevent S_refto from making a copy of the GV,
  + * tricking it to SvREFCNT_inc and point to this one instead.
  + */
  +SvPADTMP_off(sv);
  +}
  +else {
  +sv = Nullsv;
  +}
  +
  +/* o = Perl_pp_srefgen(aTHX) */
  +o = MP_pp_srefgen_ptr(aTHX);
  +
  +if (sv) {
  +/* restore original flags */
  +SvPADTMP_on(sv);
  +}
  +
  +return o;
  +}
  +
  +static void modperl_refgen_ops_fixup(void)
  +{
  +/* XXX: OP_REFGEN suffers a similar problem */
  +if (!MP_pp_srefgen_ptr) {
  +MP_pp_srefgen_ptr = PL_ppaddr[OP_SREFGEN];
  +PL_ppaddr[OP_SREFGEN] = MEMBER_TO_FPTR(modperl_pp_srefgen);
  +}
  +}
  +
  +#endif /* MP_REFGEN_FIXUP */
  +
   static void modperl_boot(void *data)
   {
   MP_dBOOT_DATA;
   dTHX; /* XXX: not too worried since this only happens at startup */
   int i;
   
  +#ifdef MP_REFGEN_FIXUP
  +modperl_refgen_ops_fixup();
  +#endif
  +
   modperl_env_clear(aTHX);
   
   modperl_env_default_populate(aTHX);
  
  
  
  1.9   +4 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_perl_includes.h   2001/11/07 03:14:54 1.8
  +++ modperl_perl_includes.h   2001/12/23 05:46:29 1.9
  @@ -35,6 +35,10 @@
   #include perl.h
   #include XSUB.h
   
  +#if (PERL_REVISION == 5)  (PERL_VERSION == 6)  (PERL_SUBVERSION == 1)
  +#   define MP_PERL_5_6_1
  +#endif
  +
   #ifdef PERL_CORE
   #   ifndef croak
   #  define croak Perl_croak_nocontext
  
  
  



cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c

2001-12-19 Thread dougm

dougm   01/12/19 10:16:41

  Modified:xs/APR/PerlIO apr_perlio.c
  Log:
  fix win32 5.6.1 compile
  
  Revision  ChangesPath
  1.6   +1 -1  modperl-2.0/xs/APR/PerlIO/apr_perlio.c
  
  Index: apr_perlio.c
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- apr_perlio.c  2001/12/18 06:00:14 1.5
  +++ apr_perlio.c  2001/12/19 18:16:41 1.6
  @@ -372,7 +372,7 @@
type);
   }
   
  -#elif !defined(PERLIO_LAYERS) /* NOT PERLIO_LAYERS (5.6.1) */
  +#elif !defined(PERLIO_LAYERS)  !defined(WIN32) /* NOT PERLIO_LAYERS (5.6.1) */
   
   static FILE *apr_perlio_apr_file_to_FILE(pTHX_ apr_file_t *file, int type)
   {
  
  
  



cvs commit: modperl-2.0/t/response/TestApache compat.pm

2001-12-19 Thread dougm

dougm   01/12/19 17:31:24

  Modified:lib/Apache compat.pm
   t/response/TestApache compat.pm
  Log:
  use/require Apache::File; compat
  
  Revision  ChangesPath
  1.32  +2 -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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- compat.pm 2001/12/14 04:52:45 1.31
  +++ compat.pm 2001/12/20 01:31:24 1.32
  @@ -32,6 +32,8 @@
   $INC{'Apache.pm'} = __FILE__;
   
   $INC{'Apache/Constants.pm'} = __FILE__;
  +
  +$INC{'Apache/File.pm'} = __FILE__;
   }
   
   package Apache;
  
  
  
  1.9   +1 -0  modperl-2.0/t/response/TestApache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- compat.pm 2001/12/14 04:52:45 1.8
  +++ compat.pm 2001/12/20 01:31:24 1.9
  @@ -84,6 +84,7 @@
   }
   }
   elsif ($data{test} eq 'Apache::File') {
  +require Apache::File;
   my $file = $vars-{t_conf_file};
   
   debug new Apache::File file object;
  
  
  



cvs commit: modperl-2.0/t/modperl getc.t readline.t sameinterp.t

2001-12-19 Thread dougm

dougm   01/12/19 19:54:41

  Modified:t/apache cgihandler.t compat.t post.t scanhdrs.t
   t/apisend_fd.t sendfile.t
   t/directive perlrequire.t
   t/filter input_body.t input_msg.t lc.t
   t/hooks  access.t trans.t
   t/modperl getc.t readline.t sameinterp.t
  Log:
  enable a bunch of tests when lwp isn't installed now that fallback is more robust
  make a few adjustments for tests to work with and without lwp
  
  Revision  ChangesPath
  1.2   +1 -1  modperl-2.0/t/apache/cgihandler.t
  
  Index: cgihandler.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/cgihandler.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cgihandler.t  2001/05/05 22:08:45 1.1
  +++ cgihandler.t  2001/12/20 03:54:40 1.2
  @@ -4,7 +4,7 @@
   use Apache::Test;
   use Apache::TestRequest;
   
  -plan tests = 2, \have_lwp;
  +plan tests = 2;
   
   my $location = /TestApache::cgihandler;
   my $str;
  
  
  
  1.9   +3 -2  modperl-2.0/t/apache/compat.t
  
  Index: compat.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/compat.t,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- compat.t  2001/12/14 04:52:45 1.8
  +++ compat.t  2001/12/20 03:54:40 1.9
  @@ -6,7 +6,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest;
   
  -plan tests = 31, todo = [25, 28, 30], \have_lwp;
  +plan tests = 31, todo = [25, 28, 30];
   
   my $location = /TestApache::compat;
   
  @@ -23,9 +23,10 @@
   # $r-content
   {
   my @data = (test = 'content');
  +my $content = join '=', @data;
   ok t_cmp(
   @data,
  -POST_BODY($location, \@data),
  +POST_BODY($location, content = $content),
   q{$r-content via POST}
   );
   }
  
  
  
  1.3   +2 -2  modperl-2.0/t/apache/post.t
  
  Index: post.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/post.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- post.t2001/04/04 04:37:00 1.2
  +++ post.t2001/12/20 03:54:40 1.3
  @@ -4,7 +4,7 @@
   use Apache::Test;
   use Apache::TestRequest;
   
  -plan tests = 2, \have_lwp;
  +plan tests = 2;
   
   my $location = /TestApache::post;
   my $str;
  @@ -12,7 +12,7 @@
   my @data = (arizona = 'wildcats');
   my %data = @data;
   
  -$str = POST_BODY $location, \@data;
  +$str = POST_BODY $location, content = @data;
   
   ok $str;
   
  
  
  
  1.2   +2 -2  modperl-2.0/t/apache/scanhdrs.t
  
  Index: scanhdrs.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/scanhdrs.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- scanhdrs.t2001/05/08 21:08:40 1.1
  +++ scanhdrs.t2001/12/20 03:54:40 1.2
  @@ -4,7 +4,7 @@
   use Apache::Test;
   use Apache::TestRequest;
   
  -plan tests = 4, \have_lwp;
  +plan tests = 4;
   
   my $module = 'TestApache::scanhdrs';
   my $location = /$module;
  @@ -13,7 +13,7 @@
   
   ok $res-content eq 1..1\nok 1\n;
   
  -ok $res-header('Content-type') eq 'text/test-output';
  +ok $res-header('Content-Type') eq 'text/test-output';
   
   ok $res-header('X-Perl-Module') eq $module;
   
  
  
  
  1.3   +3 -2  modperl-2.0/t/api/send_fd.t
  
  Index: send_fd.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/api/send_fd.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- send_fd.t 2001/10/02 13:30:31 1.2
  +++ send_fd.t 2001/12/20 03:54:41 1.3
  @@ -3,6 +3,7 @@
   
   use Test;
   use Apache::Test ();
  +use Apache::TestRequest;
   
   plan tests = 3;
   
  @@ -10,7 +11,7 @@
   
   my $url = '/TestAPI::send_fd';
   
  -my $data = $config-http_raw_get($url);
  +my $data = GET_BODY($url);
   
   ok $data;
   
  @@ -18,6 +19,6 @@
   
   ok length($data) == -s $module;
   
  -$data = $config-http_raw_get($url?noexist.txt);
  +$data = GET_BODY($url?noexist.txt);
   
   ok $data =~ /Not Found/;
  
  
  
  1.3   +3 -2  modperl-2.0/t/api/sendfile.t
  
  Index: sendfile.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/api/sendfile.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sendfile.t2001/10/02 13:30:31 1.2
  +++ sendfile.t2001/12/20 03:54:41 1.3
  @@ -3,6 +3,7 @@
   
   use Test;
   use Apache::Test ();
  +use Apache::TestRequest;
   
   plan tests = 3;
   
  @@ -10,7 +11,7 @@
   
   my $url = '/TestAPI::sendfile';
   
  -my $data = $config-http_raw_get($url);
  +my $data = GET_BODY($url);
   
   ok $data;
   
  @@ -18,6

cvs commit: modperl-2.0/t/response/TestApache subprocess.pm

2001-12-17 Thread dougm

dougm   01/12/17 16:21:02

  Modified:t/response/TestApache subprocess.pm
  Log:
  do not attempt to preload Apache::SubProcess
  
  Revision  ChangesPath
  1.2   +2 -2  modperl-2.0/t/response/TestApache/subprocess.pm
  
  Index: subprocess.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/subprocess.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- subprocess.pm 2001/12/17 16:22:07 1.1
  +++ subprocess.pm 2001/12/18 00:21:02 1.2
  @@ -118,5 +118,5 @@
   
   
   1;
  -__DATA__
  -PerlModule Apache::SubProcess
  +
  +
  
  
  



cvs commit: modperl-2.0/t/response/TestApache subprocess.pm

2001-12-17 Thread dougm

dougm   01/12/17 16:23:03

  Modified:t/response/TestApache subprocess.pm
  Log:
  skip subprocess test unless Apache::SubProcess is available
  
  Revision  ChangesPath
  1.3   +2 -2  modperl-2.0/t/response/TestApache/subprocess.pm
  
  Index: subprocess.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/subprocess.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- subprocess.pm 2001/12/18 00:21:02 1.2
  +++ subprocess.pm 2001/12/18 00:23:03 1.3
  @@ -9,7 +9,7 @@
   use Apache::TestUtil;
   use File::Spec::Functions qw(catfile catdir);
   
  -use Apache::SubProcess ();
  +eval { require Apache::SubProcess };
   
   my %scripts = (
argv   = 'print STDOUT @ARGV;',
  @@ -38,7 +38,7 @@
   my $vars = $cfg-{vars};
   
   # XXX: these tests randomly fail under 5.6.1
  -plan $r, todo = [1..4], tests = 4;
  +plan $r, todo = [1..4], tests = 4, have_module 'Apache::SubProcess';
   
   my $target_dir = catfile $vars-{documentroot}, util;
   
  
  
  



cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c

2001-12-17 Thread dougm

dougm   01/12/17 16:37:01

  Modified:xs/APR/PerlIO apr_perlio.c
  Log:
  allow to compile with older bleedperls
  
  Revision  ChangesPath
  1.3   +9 -2  modperl-2.0/xs/APR/PerlIO/apr_perlio.c
  
  Index: apr_perlio.c
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_perlio.c  2001/12/17 16:55:46 1.2
  +++ apr_perlio.c  2001/12/18 00:37:01 1.3
  @@ -12,7 +12,7 @@
* PERLIO_LAYERS is available in 5.7.1
*/
   
  -#ifdef PERLIO_LAYERS /* 5.7.2+ */
  +#if defined(PERLIO_LAYERS)  defined(PERLIO_K_MULTIARG) /* 5.7.2+ */
   
   /**
* The PerlIO APR layer.
  @@ -377,7 +377,7 @@
type);
   }
   
  -#else /* NOT PERLIO_LAYERS (5.6.1) */
  +#elif !defined(PERLIO_LAYERS) /* NOT PERLIO_LAYERS (5.6.1) */
   
   FILE *apr_perlio_apr_file_to_FILE(pTHX_ apr_file_t *file, int type)
   {
  @@ -445,6 +445,13 @@
   void apr_perlio_init(pTHX)
   {
   APR_REGISTER_OPTIONAL_FN(apr_perlio_apr_file_to_glob);
  +}
  +
  +#else
  +
  +void apr_perlio_init(pTHX)
  +{
  +Perl_croak(aTHX_ APR::PerlIO not usable with this version of Perl);
   }
   
   #endif /* PERLIO_LAYERS */
  
  
  



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

2001-12-17 Thread dougm

dougm   01/12/17 16:43:37

  Modified:t/response/TestAPR perlio.pm
  Log:
  we do want have_perl iolayers in the plan for 5.6.1
  
  Revision  ChangesPath
  1.3   +1 -1  modperl-2.0/t/response/TestAPR/perlio.pm
  
  Index: perlio.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- perlio.pm 2001/12/18 00:36:22 1.2
  +++ perlio.pm 2001/12/18 00:43:37 1.3
  @@ -23,7 +23,7 @@
   return Apache::OK;
   }
   
  -plan $r, tests = 9, todo = [5];
  +plan $r, tests = 9, todo = [5], have_perl 'iolayers';
   
   my $vars = Apache::Test::config()-{vars};
   my $dir  = catfile $vars-{documentroot}, perlio;
  
  
  



cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c

2001-12-17 Thread dougm

dougm   01/12/17 17:13:15

  Modified:xs/APR/PerlIO apr_perlio.c
  Log:
  style nits:
  - no //comments
  - no else branch where if returns a value
  - whitespace--
  
  make note that modperl_* functions cannot be used outside of httpd
  
  Revision  ChangesPath
  1.4   +33 -36modperl-2.0/xs/APR/PerlIO/apr_perlio.c
  
  Index: apr_perlio.c
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_perlio.c  2001/12/18 00:37:01 1.3
  +++ apr_perlio.c  2001/12/18 01:13:15 1.4
  @@ -31,7 +31,7 @@
*/
   static IV PerlIOAPR_popped(PerlIO *f)
   {
  -//PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
  +/* PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR); */
   
   return 0;
   }
  @@ -48,7 +48,7 @@
   apr_status_t rc;
   SV *sv;
   
  -if ( !(SvROK(arg) || SvPOK(arg)) ) {
  +if (!(SvROK(arg) || SvPOK(arg))) {
   return NULL;
   }
   
  @@ -78,6 +78,7 @@
   st = PerlIOSelf(f, PerlIOAPR);
   
   sv = args[narg-1];
  +/* XXX: modperl_sv2pool cannot be used outside of httpd */
   st-pool = modperl_sv2pool(aTHX_ sv);
 
   rc = apr_file_open(st-file, path, apr_flag, APR_OS_DEFAULT, st-pool);
  @@ -85,10 +86,9 @@
   PerlIOBase(f)-flags |= PERLIO_F_ERROR;
   return NULL;
   }
  -else {
  -PerlIOBase(f)-flags |= PERLIO_F_OPEN;
  -return f;
  -}
  +
  +PerlIOBase(f)-flags |= PERLIO_F_OPEN;
  +return f;
   }
   
   static IV PerlIOAPR_fileno(PerlIO *f)
  @@ -105,7 +105,7 @@
   {
   apr_status_t rc;

  -if ( (f = PerlIOBase_dup(aTHX_ f, o, param, flags)) ) {
  +if ((f = PerlIOBase_dup(aTHX_ f, o, param, flags))) {
   PerlIOAPR *fst = PerlIOSelf(f, PerlIOAPR);
   PerlIOAPR *ost = PerlIOSelf(o, PerlIOAPR);
   
  @@ -117,10 +117,8 @@
   }
   
   return NULL;
  -
   }
   
  -
   /* currrently read is very not-optimized, since in many cases the read
* process happens a char by char. Need to find a way to snoop on APR
* read buffer from PerlIO, or implement our own buffering layer here
  @@ -129,33 +127,33 @@
   {
   PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
   apr_status_t rc;
  -dTHX;
  +dTHX; /* XXX: change Perl so this function has a pTHX_ prototype */
   
  -//fprintf(stderr, in  read: count %d, %s\n, (int)count, (char*) vbuf);
  +/* fprintf(stderr, in  read: count %d, %s\n,
  +   (int)count, (char*) vbuf); */
   rc = apr_file_read(st-file, vbuf, count);
  -//fprintf(stderr, out read: count %d, %s\n, (int)count, (char*) vbuf);
  +/* fprintf(stderr, out read: count %d, %s\n,
  +   (int)count, (char*) vbuf); */
   if (rc == APR_SUCCESS) {
   return (SSize_t) count;
   }
  -else {
  -return (SSize_t) -1;
  -}
  -}
   
  +return (SSize_t) -1;
  +}
   
   static SSize_t PerlIOAPR_write(PerlIO *f, const void *vbuf, Size_t count)
   {
   PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
   apr_status_t rc;
   
  -//fprintf(stderr, in write: count %d, %s\n, (int)count, (char*) vbuf);
  +/* fprintf(stderr, in write: count %d, %s\n,
  +   (int)count, (char*) vbuf); */
   rc = apr_file_write(st-file, vbuf, count);
   if (rc == APR_SUCCESS) {
   return (SSize_t) count;
   }
  -else {
  -return (SSize_t) -1;
  -}
  +
  +return (SSize_t) -1;
   }
   
   static IV PerlIOAPR_seek(PerlIO *f, Off_t offset, int whence)
  @@ -186,9 +184,8 @@
   if (rc == APR_SUCCESS) {
   return 0;
   }
  -else {
  -return -1;
  -}
  +
  +return -1;
   }
   
   static Off_t PerlIOAPR_tell(PerlIO *f)
  @@ -202,10 +199,9 @@
   rc = apr_file_seek(st-file, APR_CUR, offset);
   if (rc == APR_SUCCESS) {
   return (Off_t) offset;
  -}
  -else {
  -return (Off_t) -1;
   }
  +
  +return (Off_t) -1;
   }
   
   static IV PerlIOAPR_close(PerlIO *f)
  @@ -216,7 +212,7 @@
   
   const char *new_path;
   apr_file_name_get(new_path, st-file);
  -//fprintf(stderr, closing file %s\n, new_path);
  +/* fprintf(stderr, closing file %s\n, new_path); */
   
   rc = apr_file_flush(st-file);
   if (rc != APR_SUCCESS) {
  @@ -240,9 +236,8 @@
   if (rc == APR_SUCCESS) {
   return 0;
   }
  -else {
  -return -1;
  -}
  +
  +return -1;
   }
   
   static IV PerlIOAPR_fill(PerlIO *f)
  @@ -262,8 +257,9 @@
 case APR_EOF:
   return 1;
 default:
  -return -1;
   }
  +
  +return -1;
   }
   
   static PerlIO_funcs PerlIO_APR = {
  @@ -338,10 +334,9 @@
   PerlIOBase(f)-flags |= PERLIO_F_OPEN;
   
   return f;
  -}
  -else {
  -return NULL;
   }
  +
  +return NULL;
   }
   
   /*
  @@ -349,6

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

2001-12-17 Thread dougm

dougm   01/12/17 17:55:52

  Modified:xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.54  +34 -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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- FunctionTable.pm  2001/12/15 23:51:43 1.53
  +++ FunctionTable.pm  2001/12/18 01:55:52 1.54
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Sat Dec 15 15:39:57 2001
  +# !  Mon Dec 17 17:56:17 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -3335,6 +3335,39 @@
 {
   'type' = 'void *',
   'name' = 'cfg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'int',
  +'name' = 'modperl_spawn_proc_prog',
  +'attr' = [
  +  'static'
  +],
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'command'
  +  },
  +  {
  +'type' = 'const char ***',
  +'name' = 'argv'
  +  },
  +  {
  +'type' = 'apr_file_t **',
  +'name' = 'script_in'
  +  },
  +  {
  +'type' = 'apr_file_t **',
  +'name' = 'script_out'
  +  },
  +  {
  +'type' = 'apr_file_t **',
  +'name' = 'script_err'
 }
   ]
 },
  
  
  



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

2001-12-17 Thread dougm

dougm   01/12/17 17:56:47

  Modified:t/apache .cvsignore
   t/apr.cvsignore
  Log:
  ignores
  
  Revision  ChangesPath
  1.3   +1 -0  modperl-2.0/t/apache/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore2001/09/12 17:11:47 1.2
  +++ .cvsignore2001/12/18 01:56:47 1.3
  @@ -6,3 +6,4 @@
   read.t
   scanhdrs.t
   write.t
  +subprocess.t
  
  
  
  1.3   +1 -0  modperl-2.0/t/apr/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/apr/.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/12/18 01:56:47 1.3
  @@ -5,3 +5,4 @@
   pool.t
   table.t
   uuid.t
  +perlio.t
  
  
  



cvs commit: modperl-2.0/xs/APR/PerlIO .cvsignore

2001-12-17 Thread dougm

dougm   01/12/17 17:57:55

  Added:   xs/APR/PerlIO .cvsignore
  Log:
  ignore
  
  Revision  ChangesPath
  1.1  modperl-2.0/xs/APR/PerlIO/.cvsignore
  
  Index: .cvsignore
  ===
  PerlIO.bs
  PerlIO.c
  Makefile
  pm_to_blib
  
  
  



cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h

2001-12-17 Thread dougm

dougm   01/12/17 19:21:22

  Modified:xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  a few style fixups and comments
  
  Revision  ChangesPath
  1.2   +46 -45modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Apache__SubProcess.h  2001/12/17 16:22:07 1.1
  +++ Apache__SubProcess.h  2001/12/18 03:21:22 1.2
  @@ -2,9 +2,7 @@
   
   #ifndef MP_SOURCE_SCAN
   #include apr_optional.h
  -#endif
   
  -#ifndef MP_SOURCE_SCAN
   static APR_OPTIONAL_FN_TYPE(apr_perlio_apr_file_to_glob) *apr_file_to_glob;
   #endif
   
  @@ -17,9 +15,12 @@
   apr_cmdtype_e  cmd_type;
   } exec_info;
   
  -
   #define FAILED(command) ((rc = command) != APR_SUCCESS)
   
  +#define SET_TIMEOUT(fp) \
  +apr_file_pipe_timeout_set(fp, \
  +  (int)(r-server-timeout * APR_USEC_PER_SEC))
  +
   static int modperl_spawn_proc_prog(request_rec *r,
  const char *command,
  const char ***argv,
  @@ -34,27 +35,26 @@
   apr_procattr_t *procattr;
   apr_proc_t *procnew;
   apr_status_t rc = APR_SUCCESS;
  -
  +
   e_info.in_pipe   = APR_CHILD_BLOCK;
   e_info.out_pipe  = APR_CHILD_BLOCK;
   e_info.err_pipe  = APR_CHILD_BLOCK;
   e_info.cmd_type  = APR_PROGRAM;
  -
  + 
   p = r-main ? r-main-pool : r-pool;
  +
  +*script_out = *script_in = *script_err = NULL;
  +
  +env = (const char * const *)ap_create_environment(p, r-subprocess_env);
   
  -*script_out = NULL;
  -*script_in  = NULL;
  -*script_err = NULL;
  -
  -env = (const char* const*)ap_create_environment(p, r-subprocess_env);
  -
  -if ( FAILED(apr_procattr_create(procattr, p)) ||
  - FAILED(apr_procattr_io_set(procattr, e_info.in_pipe,
  -e_info.out_pipe, e_info.err_pipe)) ||
  - FAILED(apr_procattr_dir_set(procattr, 
  - ap_make_dirstr_parent(r-pool,
  -   r-filename))) ||
  - FAILED(apr_procattr_cmdtype_set(procattr, e_info.cmd_type))) {
  +if (FAILED(apr_procattr_create(procattr, p)) ||
  +FAILED(apr_procattr_io_set(procattr, e_info.in_pipe,
  +   e_info.out_pipe, e_info.err_pipe)) ||
  +FAILED(apr_procattr_dir_set(procattr, 
  +ap_make_dirstr_parent(r-pool,
  +  r-filename))) ||
  +FAILED(apr_procattr_cmdtype_set(procattr, e_info.cmd_type)))
  +{
   /* Something bad happened, tell the world. */
   ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
 couldn't set child process attributes: %s,
  @@ -63,49 +63,47 @@
   }
   
   procnew = apr_pcalloc(p, sizeof(*procnew));
  -if FAILED(ap_os_create_privileged_process(r, procnew, command,
  -  *argv, env, procattr, p)) {
  +if (FAILED(ap_os_create_privileged_process(r, procnew, command,
  +  *argv, env, procattr, p)))
  +{
   /* Bad things happened. Everyone should have cleaned up. */
   ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
  -  couldn't create child process: %d: %s, rc, r-filename);
  +  couldn't create child process: %d: %s,
  +  rc, r-filename);
   return rc;
   }
   
   apr_pool_note_subprocess(p, procnew, kill_after_timeout);
   
  -*script_in = procnew-in;
  -if (!*script_in) {
  +if (!(*script_in = procnew-in)) {
  +/* XXX: this needs to be Perl_croak(aTHX_ ...)
  + * or go away so we can compile with -DPERL_CORE
  + */
   croak(broken program-in stream);
   return APR_EBADF;
   }
  -apr_file_pipe_timeout_set(*script_in,
  -  (int)(r-server-timeout * APR_USEC_PER_SEC));
  +SET_TIMEOUT(*script_in);
   
  -*script_out = procnew-out;
  -if (!*script_out) {
  +if (!(*script_out = procnew-out)) {
   croak(broken program-out stream);
   return APR_EBADF;
   }
  -apr_file_pipe_timeout_set(*script_out,
  -  (int)(r-server-timeout * APR_USEC_PER_SEC));
  +SET_TIMEOUT(*script_in);
   
  -*script_err = procnew-err;
  -if (!*script_err) {
  +if (!(*script_err = procnew-err)) {
   croak(broken program-err stream);
   return APR_EBADF;
   }
  -apr_file_pipe_timeout_set(*script_err,
  -  (int)(r-server-timeout

cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h

2001-12-17 Thread dougm

dougm   01/12/17 19:24:49

  Modified:xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  plug av_argv memory leak
  
  Revision  ChangesPath
  1.3   +3 -1  modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Apache__SubProcess.h  2001/12/18 03:21:22 1.2
  +++ Apache__SubProcess.h  2001/12/18 03:24:49 1.3
  @@ -120,7 +120,7 @@
   
   if (items == 3) {
   if (SvROK(ST(2))  SvTYPE(SvRV(ST(2))) == SVt_PVAV) {
  -av_argv = (AV*)SvRV(ST(2));
  +av_argv = (AV*)SvREFCNT_inc(SvRV(ST(2)));
   }
   else {
   Perl_croak(aTHX_ usage);
  @@ -149,6 +149,8 @@
   rc = modperl_spawn_proc_prog(r, command, argv,
script_in, script_out,
script_err);
  +
  +SvREFCNT_dec(av_argv);
   
   if (rc == APR_SUCCESS) {
   /* XXX: apr_file_to_glob should be set once in the BOOT: section */
  
  
  



cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h

2001-12-17 Thread dougm

dougm   01/12/17 19:40:02

  Modified:xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  avoid calling av_len() more than once.
  switch from using av_len() to AvFILLp
  add av_items variable to avoid (-1 + 2) when there is no av_argv
  
  Revision  ChangesPath
  1.4   +9 -6  modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Apache__SubProcess.h  2001/12/18 03:24:49 1.3
  +++ Apache__SubProcess.h  2001/12/18 03:40:02 1.4
  @@ -115,12 +115,15 @@
   const char **argv;
   int i;
   AV *av_argv;
  +I32 len=-1, av_items=0;
   request_rec *r = modperl_xs_sv2request_rec(aTHX_ ST(0), NULL, cv);
   const char *command = (const char *)SvPV_nolen(ST(1));
   
   if (items == 3) {
   if (SvROK(ST(2))  SvTYPE(SvRV(ST(2))) == SVt_PVAV) {
   av_argv = (AV*)SvREFCNT_inc(SvRV(ST(2)));
  +len = AvFILLp(av_argv);
  +av_items = len+1;
   }
   else {
   Perl_croak(aTHX_ usage);
  @@ -129,21 +132,21 @@
   else {
   av_argv = newAV();
   }
  -
  +
   /* ap_os_create_privileged_process expects ARGV as char
* **argv, with terminating NULL and the program itself as a
* first item.
*/
  -argv = apr_palloc(r-pool,
  -  (3 + av_len(av_argv)) * sizeof(char *));
  +argv = apr_palloc(r-pool, (av_items + 2) * sizeof(char *));
   argv[0] = command;
  -for (i = 0; i = av_len(av_argv); i++) {
  +for (i = 0; i = len; i++) {
   argv[i+1] = (const char *)SvPV_nolen(AvARRAY(av_argv)[i]);
   }
   argv[i+1] = NULL;
   #if 0
  -for (i=0; i=av_len(av_argv)+2; i++) {
  -Perl_warn(aTHX_ arg: %d %s\n, i, argv[i]);
  +for (i=0; i=len+2; i++) {
  +Perl_warn(aTHX_ arg: %d %s\n,
  +  i, argv[i] ? argv[i] : NULL);
   }
   #endif
   rc = modperl_spawn_proc_prog(r, command, argv,
  
  
  



cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h

2001-12-17 Thread dougm

dougm   01/12/17 19:44:33

  Modified:xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  dont bother creating an empty av_argv if no args are passed into spawn_proc_prog
  
  Revision  ChangesPath
  1.5   +7 -10 modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Apache__SubProcess.h  2001/12/18 03:40:02 1.4
  +++ Apache__SubProcess.h  2001/12/18 03:44:33 1.5
  @@ -113,15 +113,15 @@
   apr_file_t *script_in, *script_out, *script_err;
   apr_status_t rc;
   const char **argv;
  -int i;
  -AV *av_argv;
  +int i=0;
  +AV *av_argv = Nullav;
   I32 len=-1, av_items=0;
   request_rec *r = modperl_xs_sv2request_rec(aTHX_ ST(0), NULL, cv);
   const char *command = (const char *)SvPV_nolen(ST(1));
   
   if (items == 3) {
   if (SvROK(ST(2))  SvTYPE(SvRV(ST(2))) == SVt_PVAV) {
  -av_argv = (AV*)SvREFCNT_inc(SvRV(ST(2)));
  +av_argv = (AV*)SvRV(ST(2));
   len = AvFILLp(av_argv);
   av_items = len+1;
   }
  @@ -129,9 +129,6 @@
   Perl_croak(aTHX_ usage);
   }
   }
  -else {
  -av_argv = newAV();
  -}
   
   /* ap_os_create_privileged_process expects ARGV as char
* **argv, with terminating NULL and the program itself as a
  @@ -139,8 +136,10 @@
*/
   argv = apr_palloc(r-pool, (av_items + 2) * sizeof(char *));
   argv[0] = command;
  -for (i = 0; i = len; i++) {
  -argv[i+1] = (const char *)SvPV_nolen(AvARRAY(av_argv)[i]);
  +if (av_argv) {
  +for (i = 0; i = len; i++) {
  +argv[i+1] = (const char *)SvPV_nolen(AvARRAY(av_argv)[i]);
  +}
   }
   argv[i+1] = NULL;
   #if 0
  @@ -152,8 +151,6 @@
   rc = modperl_spawn_proc_prog(r, command, argv,
script_in, script_out,
script_err);
  -
  -SvREFCNT_dec(av_argv);
   
   if (rc == APR_SUCCESS) {
   /* XXX: apr_file_to_glob should be set once in the BOOT: section */
  
  
  



cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h

2001-12-17 Thread dougm

dougm   01/12/17 19:54:49

  Modified:xs/Apache/SubProcess Apache__SubProcess.h
  Log:
  cut down some duplication with PUSH_FILE_GLOB_* macros
  
  Revision  ChangesPath
  1.6   +15 -9 modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h
  
  Index: Apache__SubProcess.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Apache__SubProcess.h  2001/12/18 03:44:33 1.5
  +++ Apache__SubProcess.h  2001/12/18 03:54:49 1.6
  @@ -99,6 +99,15 @@
   return rc;
   }
   
  +#define PUSH_FILE_GLOB(fp, type) \
  +PUSHs(apr_file_to_glob(aTHX_ fp, r-pool, type))
  +
  +#define PUSH_FILE_GLOB_READ(fp) \
  +PUSH_FILE_GLOB(fp, APR_PERLIO_HOOK_READ)
  +
  +#define PUSH_FILE_GLOB_WRITE(fp) \
  +PUSH_FILE_GLOB(fp, APR_PERLIO_HOOK_WRITE)
  +
   static XS(MPXS_modperl_spawn_proc_prog)
   {
   dXSARGS;
  @@ -161,9 +170,8 @@
   /* XXX: need to do lots of error checking before
* putting the object on the stack
*/
  -SV *out = apr_file_to_glob(aTHX_ script_out, r-pool,
  -   APR_PERLIO_HOOK_READ);
  -XPUSHs(out);
  +EXTEND(SP, 1);
  +PUSH_FILE_GLOB_READ(script_out);
   
   rc = apr_file_close(script_in);
   if (rc != APR_SUCCESS) {
  @@ -176,12 +184,10 @@
   }
   }
   else {
  -XPUSHs(apr_file_to_glob(aTHX_ script_in,
  -r-pool, APR_PERLIO_HOOK_WRITE));
  -XPUSHs(apr_file_to_glob(aTHX_ script_out,
  -r-pool, APR_PERLIO_HOOK_READ));
  -XPUSHs(apr_file_to_glob(aTHX_ script_err,
  -r-pool, APR_PERLIO_HOOK_READ));
  +EXTEND(SP, 3);
  +PUSH_FILE_GLOB_WRITE(script_in);
  +PUSH_FILE_GLOB_READ(script_out);
  +PUSH_FILE_GLOB_READ(script_err);
   }
   }
   else {
  
  
  



cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h

2001-12-17 Thread dougm

dougm   01/12/17 19:56:44

  Modified:xs/Apache/Filter Apache__Filter.h
  Log:
  s/croak/Perl_croak/ so we compile with -DPERL_CORE
  Submitted by: stas
  Reviewed by:  dougm
  
  Revision  ChangesPath
  1.16  +2 -2  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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Apache__Filter.h  2001/10/07 19:22:49 1.15
  +++ Apache__Filter.h  2001/12/18 03:56:44 1.16
  @@ -26,7 +26,7 @@
   mpxs_write_loop(modperl_output_filter_write, modperl_filter);
   }
   else {
  -croak(input filters not yet supported);
  +Perl_croak(aTHX_ input filters not yet supported);
   }
   
   /* XXX: ap_rflush if $| */
  @@ -54,7 +54,7 @@
   len = modperl_output_filter_read(aTHX_ modperl_filter, buffer, wanted);
   }
   else {
  -croak(input filters not yet supported);
  +Perl_croak(aTHX_ input filters not yet supported);
   }
   
   return len;
  
  
  



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

2001-12-17 Thread dougm

dougm   01/12/17 21:58:54

  Modified:lib/ModPerl Code.pm
  Log:
  generate a modperl_largefiles.h include file with the
  $Config{ccflags_uselargefiles} we have ripped out when compiling
  modperl.
  
  Revision  ChangesPath
  1.74  +16 -0 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.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- Code.pm   2001/12/05 02:22:24 1.73
  +++ Code.pm   2001/12/18 05:58:54 1.74
  @@ -466,6 +466,21 @@
   ();
   }
   
  +sub generate_largefiles {
  +my($self, $h_fh) = @_;
  +
  +my $flags = $self-perl_config('ccflags_uselargefiles');
  +
  +return unless $flags;
  +
  +for my $flag (split /\s+/, $flags) {
  +my($name, $val) = split '=', $flag;
  +$val ||= '';
  +$name =~ s/^-D//;
  +print $h_fh #define $name $val\n;
  +}
  +}
  +
   sub ins_underscore {
   $_[0] =~ s/([a-z])([A-Z])/$1_$2/g;
   }
  @@ -526,6 +541,7 @@
  generate_flags  = {h = 'modperl_flags.h',
  c = 'modperl_flags.c'},
  generate_trace  = {h = 'modperl_trace.h'},
  +   generate_largefiles = {h = 'modperl_largefiles.h'},
  generate_constants  = {h = 'modperl_constants.h',
  c = 'modperl_constants.c'},
   );
  
  
  



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

2001-12-17 Thread dougm

dougm   01/12/17 22:01:43

  Modified:t/response/TestAPR perlio.pm
  Log:
  tell works now; remove todo
  
  Revision  ChangesPath
  1.4   +1 -1  modperl-2.0/t/response/TestAPR/perlio.pm
  
  Index: perlio.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- perlio.pm 2001/12/18 00:43:37 1.3
  +++ perlio.pm 2001/12/18 06:01:43 1.4
  @@ -23,7 +23,7 @@
   return Apache::OK;
   }
   
  -plan $r, tests = 9, todo = [5], have_perl 'iolayers';
  +plan $r, tests = 9, have_perl 'iolayers';
   
   my $vars = Apache::Test::config()-{vars};
   my $dir  = catfile $vars-{documentroot}, perlio;
  
  
  



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

2001-12-17 Thread dougm

dougm   01/12/17 22:02:29

  Modified:t/response/TestAPR perlio.pm
  Log:
  tell works now; XXX broken comment
  
  Revision  ChangesPath
  1.5   +1 -1  modperl-2.0/t/response/TestAPR/perlio.pm
  
  Index: perlio.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- perlio.pm 2001/12/18 06:01:43 1.4
  +++ perlio.pm 2001/12/18 06:02:29 1.5
  @@ -80,7 +80,7 @@
   
   my $pos = 3;
   seek $fh, $pos, Fcntl::SEEK_SET();
  -# XXX: broken
  +
   my $got = tell($fh);
   ok t_cmp($pos,
$got,
  
  
  



cvs commit: modperl-2.0/pod modperl_dev.pod

2001-12-15 Thread dougm

dougm   01/12/15 15:45:05

  Modified:lib/ModPerl BuildOptions.pm
   pod  modperl_dev.pod
  Log:
  make MP_GENERATE_XS=1 the default
  
  Revision  ChangesPath
  1.13  +1 -0  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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BuildOptions.pm   2001/11/21 02:13:00 1.12
  +++ BuildOptions.pm   2001/12/15 23:45:05 1.13
  @@ -25,6 +25,7 @@
   }
   
   $build-{MP_USE_DSO} = 1 unless $build-{MP_USE_STATIC};
  +$build-{MP_GENERATE_XS} = 1 unless exists $build-{MP_GENERATE_XS};
   }
   
   sub parse {
  
  
  
  1.46  +2 -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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- modperl_dev.pod   2001/12/13 18:09:41 1.45
  +++ modperl_dev.pod   2001/12/15 23:45:05 1.46
  @@ -64,8 +64,7 @@
   =head2 Create the build environment
   
 % cd modperl-2.0
  -  % perl Makefile.PL MP_GENERATE_XS=1 \
  -MP_APXS=$apache_prefix/bin/apxs  make
  +  % perl Makefile.PL MP_APXS=$apache_prefix/bin/apxs  make
   
   Ioptions an optional list of (key,value) pairs.
   
  @@ -80,6 +79,7 @@
   =item MP_GENERATE_XS
   
   Generate xs code from parsed source headers in Ixs/tables/$httpd_version.
  +Default is 1, set to 0 to disable.
   
   =item MP_USE_DSO
   
  
  
  



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

2001-12-15 Thread dougm

dougm   01/12/15 15:51:43

  Modified:xs/tables/current/Apache ConstantsTable.pm FunctionTable.pm
StructureTable.pm
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.19  +2 -2  modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm
  
  Index: ConstantsTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ConstantsTable.pm 2001/11/19 22:40:12 1.18
  +++ ConstantsTable.pm 2001/12/15 23:51:43 1.19
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Mon Nov 19 14:57:24 2001
  +# !  Sat Dec 15 15:39:22 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -291,6 +291,7 @@
 'APR_APPEND',
 'APR_TRUNCATE',
 'APR_BINARY',
  +  'APR_EXCL',
 'APR_BUFFERED',
 'APR_DELONCLOSE'
   ],
  @@ -346,7 +347,6 @@
 'APR_ENETUNREACH',
 'APR_EFTYPE',
 'APR_EPIPE',
  -  'APR_EXCL',
 'APR_END'
   ],
   'common' = [
  
  
  
  1.28  +168 -61   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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FunctionTable.pm  2001/11/19 22:40:12 1.27
  +++ FunctionTable.pm  2001/12/15 23:51:43 1.28
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Mon Nov 19 14:57:32 2001
  +# !  Sat Dec 15 15:39:32 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -1041,6 +1041,11 @@
   ]
 },
 {
  +'return_type' = 'global_score *',
  +'name' = 'ap_get_global_scoreboard',
  +'args' = []
  +  },
  +  {
   'return_type' = 'unsigned long',
   'name' = 'ap_get_limit_req_body',
   'args' = [
  @@ -3718,6 +3723,28 @@
 },
 {
   'return_type' = 'int',
  +'name' = 'ap_rgetline',
  +'args' = [
  +  {
  +'type' = 'char **',
  +'name' = 's'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'n'
  +  },
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'fold'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'int',
   'name' = 'ap_rind',
   'args' = [
 {
  @@ -3999,7 +4026,7 @@
   ]
 },
 {
  -'return_type' = 'void',
  +'return_type' = 'int',
   'name' = 'ap_run_open_logs',
   'args' = [
 {
  @@ -4026,7 +4053,7 @@
   'args' = []
 },
 {
  -'return_type' = 'void',
  +'return_type' = 'int',
   'name' = 'ap_run_post_config',
   'args' = [
 {
  @@ -6258,6 +6285,32 @@
   ]
 },
 {
  +'return_type' = 'void',
  +'name' = 'apr_dbm_get_usednames_ex',
  +'args' = [
  +  {
  +'type' = 'apr_pool_t *',
  +'name' = 'pool'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'type'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'pathname'
  +  },
  +  {
  +'type' = 'const char **',
  +'name' = 'used1'
  +  },
  +  {
  +'type' = 'const char **',
  +'name' = 'used2'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'char *',
   'name' = 'apr_dbm_geterror',
   'args' = [
  @@ -6321,6 +6374,36 @@
 },
 {
   'return_type' = 'apr_status_t',
  +'name' = 'apr_dbm_open_ex',
  +'args' = [
  +  {
  +'type' = 'apr_dbm_t **',
  +'name' = 'dbm'
  +  },
  +  {
  +'type' = 'const char*',
  +'name' = 'type'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'name'
  +  },
  +  {
  +'type' = 'apr_int32_t',
  +'name' = 'mode'
  +  },
  +  {
  +'type' = 'apr_fileperms_t',
  +'name' = 'perm'
  +  },
  +  {
  +'type' = 'apr_pool_t *',
  +'name' = 'cntxt'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_status_t',
   'name' = 'apr_dbm_store',
   'args' = [
 {
  @@ -7265,6 +7348,24 @@
 },
 {
   'return_type' = 'apr_status_t',
  +'name' = 'apr_get_groupid',
  +'args' = [
  +  {
  +'type' = 'apr_gid_t *',
  +'name' = 'groupid

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

2001-12-15 Thread dougm

dougm   01/12/15 15:51:13

  Modified:xs/maps  apr_functions.map
  Log:
  adjust to apr_pool_create() change
  
  Revision  ChangesPath
  1.26  +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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- apr_functions.map 2001/10/22 01:52:06 1.25
  +++ apr_functions.map 2001/12/15 23:51:13 1.26
  @@ -141,7 +141,7 @@
apr_pool_cleanup_for_exec
apr_pool_clear
apr_pool_destroy
  - apr_pool_t *:apr_pool_create | mpxs_ | SV *:obj | new
  + apr_pool_t *:DEFINE_new | mpxs_apr_pool_create | SV *:obj
apr_pool_userdata_get
apr_pool_userdata_set
   apr_pool_alloc_init
  
  
  



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

2001-12-11 Thread dougm

dougm   01/12/11 15:20:34

  Modified:src/modules/perl mod_perl.c
  Log:
  suspend END blocks to be run at server shutdown
  
  Revision  ChangesPath
  1.99  +7 -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.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- mod_perl.c2001/12/04 22:43:07 1.98
  +++ mod_perl.c2001/12/11 23:20:34 1.99
  @@ -75,6 +75,7 @@
   
   PerlInterpreter *modperl_startup(server_rec *s, apr_pool_t *p)
   {
  +AV *endav;
   dTHXa(NULL);
   MP_dSCFG(s);
   PerlInterpreter *perl;
  @@ -116,7 +117,13 @@
   exit(1);
   }
   
  +/* suspend END blocks to be run at server shutdown */
  +endav = PL_endav;
  +PL_endav = Nullav;
  +
   perl_run(perl);
  +
  +PL_endav = endav;
   
   MP_TRACE_i(MP_FUNC, constructed interpreter=0x%lx\n,
  (unsigned long)perl);
  
  
  



cvs commit: modperl Changes

2001-12-10 Thread dougm

dougm   01/12/10 19:29:44

  Modified:src/modules/win32 mod_perl.def
   apacimod_perl.exp
   .Changes
  Log:
  added perl_perl_merge_dir_config and array_header2avrv symbols to
  mod_perl.def for win32 and mod_perl.exp for aix
  Submitted by: Randy Kobes [EMAIL PROTECTED]
  Reviewed by:  dougm
  
  Revision  ChangesPath
  1.5   +2 -0  modperl/src/modules/win32/mod_perl.def
  
  Index: mod_perl.def
  ===
  RCS file: /home/cvs/modperl/src/modules/win32/mod_perl.def,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_perl.def  2001/07/09 15:03:16 1.4
  +++ mod_perl.def  2001/12/11 03:29:42 1.5
  @@ -14,3 +14,5 @@
  perl_call_handler
  perl_clear_symtab
  perl_get_startup_pool
  +   perl_perl_merge_dir_config
  +   array_header2avrv
  
  
  
  1.6   +2 -0  modperl/apaci/mod_perl.exp
  
  Index: mod_perl.exp
  ===
  RCS file: /home/cvs/modperl/apaci/mod_perl.exp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_perl.exp  2001/07/09 15:03:28 1.5
  +++ mod_perl.exp  2001/12/11 03:29:42 1.6
  @@ -13,3 +13,5 @@
   perl_call_handler
   perl_clear_symtab
   perl_get_startup_pool
  +perl_perl_merge_dir_config
  +array_header2avrv
  
  
  
  1.624 +4 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.623
  retrieving revision 1.624
  diff -u -r1.623 -r1.624
  --- Changes   2001/11/15 08:23:40 1.623
  +++ Changes   2001/12/11 03:29:43 1.624
  @@ -10,6 +10,10 @@
   
   =item 1.26_01-dev
   
  +added perl_perl_merge_dir_config and array_header2avrv symbols to
  +mod_perl.def for win32 and mod_perl.exp for aix.
  +[Randy Kobes [EMAIL PROTECTED]]
  +
   INSTALL.apaci: added an explanation of how perl has to be built in
   order to use DSO without problems (copied from the guide) based on
   email from Doug.  [Stas Bekman [EMAIL PROTECTED]]
  
  
  



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

2001-12-10 Thread dougm

dougm   01/12/10 20:22:32

  Modified:src/modules/perl modperl_perl.c
  Log:
  call END blocks before interpreter shutdown
  
  Revision  ChangesPath
  1.9   +4 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_perl.c2001/11/02 02:59:32 1.8
  +++ modperl_perl.c2001/12/11 04:22:32 1.9
  @@ -100,6 +100,10 @@
   PL_origenviron = environ;
   #endif
   
  +if (PL_endav) {
  +modperl_perl_call_list(pTHX_ PL_endav, END);
  +}
  +
   perl_destruct(perl);
   
   /* XXX: big bug in 5.6.1 fixed in 5.7.2+
  
  
  



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

2001-12-06 Thread dougm

dougm   01/12/06 20:47:13

  Modified:t/response/TestModperl getc.pm
  Log:
  always untie/tie STDIN
  
  Revision  ChangesPath
  1.2   +2 -1  modperl-2.0/t/response/TestModperl/getc.pm
  
  Index: getc.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/getc.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- getc.pm   2001/11/07 04:04:14 1.1
  +++ getc.pm   2001/12/07 04:47:13 1.2
  @@ -8,7 +8,8 @@
   sub handler {
   my $r = shift;
   
  -tie *STDIN, $r unless tied *STDIN;
  +untie *STDIN;
  +tie *STDIN, $r;
   
   while (my $c = getc) {
   die got more than 1 char unless length($c) == 1;
  
  
  



Re: http://perl.apache.org/tidbits.html

2001-12-05 Thread dougm

On Sun, 28 Oct 2001, Paul DuBois wrote:

 I don't know if you're still maintaing the list of publications
 that mention mod_perl...looks like maybe not, given the dates on
 the items.  But if you are, this book (by me) has a chapter on
 mod_perl in the context of using MySQL/DBI/Apache:
 
 http://www.kitebird.com/mysql-perl/

hi paul, thanks for the info.  i haven't been maintaining that page, and a
new site is under construction.  i'm not sure if that info will be carried
over or not, but i've cc'd the list.  would be interesting to see that
page brought up to date.




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

2001-12-05 Thread dougm

dougm   01/12/05 11:09:37

  Modified:lib/Apache compat.pm
  Log:
  more info in Apache::File-tmpfile if Apache-request isn't available
  
  Revision  ChangesPath
  1.27  +3 -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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- compat.pm 2001/12/05 16:03:25 1.26
  +++ compat.pm 2001/12/05 19:09:37 1.27
  @@ -302,13 +302,14 @@
   my $limit = 100;
   my $r = Apache-request;
   unless ($r) {
  -die 'PerlOptions +GlobalRequest' setting is required;
  +die cannot use Apache::File-tmpfile .
  +  without 'SetHandler perl-script' or 'PerlOptions +GlobalRequest';
   }
   while ($limit--) {
   my $tmpfile = $TMPDIR/${$} . $TMPNAM++;
   my $fh = $class-new;
   sysopen($fh, $tmpfile, $Mode, $Perms);
  -$r-pool-cleanup_register(sub { unlink $tmpfile }) if $r;
  +$r-pool-cleanup_register(sub { unlink $tmpfile });
   if ($fh) {
return wantarray ? ($tmpfile, $fh) : $fh;
}
  
  
  



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

2001-12-05 Thread dougm

dougm   01/12/05 11:11:34

  Modified:lib/Apache compat.pm
  Log:
  some whitespace style nits
  remove redundant use of Apache::{Response,RequestRec}
  
  Revision  ChangesPath
  1.28  +4 -3  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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- compat.pm 2001/12/05 19:09:37 1.27
  +++ compat.pm 2001/12/05 19:11:34 1.28
  @@ -290,7 +290,6 @@
   close $self;
   }
   
  -
   my $TMPNAM = 'aa';
   my $TMPDIR = $ENV{'TMPDIR'} || $ENV{'TEMP'} || '/tmp';
   ($TMPDIR) = $TMPDIR =~ /^([^|;*]+)$/; #untaint
  @@ -301,15 +300,19 @@
   my $class = shift;
   my $limit = 100;
   my $r = Apache-request;
  +
   unless ($r) {
   die cannot use Apache::File-tmpfile .
 without 'SetHandler perl-script' or 'PerlOptions +GlobalRequest';
   }
  +
   while ($limit--) {
   my $tmpfile = $TMPDIR/${$} . $TMPNAM++;
   my $fh = $class-new;
  +
   sysopen($fh, $tmpfile, $Mode, $Perms);
   $r-pool-cleanup_register(sub { unlink $tmpfile });
  +
   if ($fh) {
return wantarray ? ($tmpfile, $fh) : $fh;
}
  @@ -317,7 +320,6 @@
   }
   
   # the following functions now live in Apache::Response
  -use Apache::Response;
   # * discard_request_body
   # * meets_conditions
   # * set_content_length
  @@ -326,7 +328,6 @@
   # * update_mtime
   
   # the following functions now live in Apache::RequestRec
  -use Apache::RequestRec;
   # * mtime
   
   
  
  
  



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

2001-12-05 Thread dougm

dougm   01/12/05 11:18:08

  Modified:lib/Apache compat.pm
  Log:
  untabify and better fit for tmpfile error message
  
  Revision  ChangesPath
  1.29  +5 -4  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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- compat.pm 2001/12/05 19:11:34 1.28
  +++ compat.pm 2001/12/05 19:18:08 1.29
  @@ -302,8 +302,9 @@
   my $r = Apache-request;
   
   unless ($r) {
  -die cannot use Apache::File-tmpfile .
  -  without 'SetHandler perl-script' or 'PerlOptions +GlobalRequest';
  +die cannot use Apache::File-tmpfile ,
  +without 'SetHandler perl-script' ,
  +or 'PerlOptions +GlobalRequest';
   }
   
   while ($limit--) {
  @@ -314,8 +315,8 @@
   $r-pool-cleanup_register(sub { unlink $tmpfile });
   
   if ($fh) {
  - return wantarray ? ($tmpfile, $fh) : $fh;
  - }
  +return wantarray ? ($tmpfile, $fh) : $fh;
  +}
   }
   }
   
  
  
  



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

2001-12-05 Thread dougm

dougm   01/12/05 11:57:29

  Modified:t/filter/TestFilter api.pm
  Log:
  s/use Test/use Apache::Test/
  
  Revision  ChangesPath
  1.5   +3 -13 modperl-2.0/t/filter/TestFilter/api.pm
  
  Index: api.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/api.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- api.pm2001/06/23 17:47:31 1.4
  +++ api.pm2001/12/05 19:57:29 1.5
  @@ -6,20 +6,10 @@
   use Apache::Filter ();
   use Apache::FilterRec ();
   
  -use Test;
  +use Apache::Test;
   
   my $response_data = blah blah blah;
   
  -sub init_test_pm {
  -my $filter = shift;
  -
  -tie *STDOUT, $filter;
  -
  -$Test::TESTOUT = \*STDOUT;
  -$Test::planned = 0;
  -$Test::ntest = 1;
  -}
  -
   #XXX: else pp_untie complains:
   #untie attempted while %d inner references still exist
   sub Apache::Filter::UNTIE {}
  @@ -29,7 +19,7 @@
   
   $filter-read(my $buffer); #slurp everything;
   
  -init_test_pm($filter);
  +tie *STDOUT, $filter;
   
   plan tests = 6;
   
  @@ -51,7 +41,7 @@
   
   untie *STDOUT;
   
  -0;
  +Apache::OK;
   }
   
   sub response {
  
  
  



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

2001-12-04 Thread dougm

dougm   01/12/04 21:48:39

  Modified:t/response/TestModperl readline.pm
  Log:
  always untie/tie STDIN else we may create a zombie request_rec
  
  Revision  ChangesPath
  1.2   +2 -1  modperl-2.0/t/response/TestModperl/readline.pm
  
  Index: readline.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/readline.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- readline.pm   2001/11/08 03:19:47 1.1
  +++ readline.pm   2001/12/05 05:48:39 1.2
  @@ -9,7 +9,8 @@
   sub handler {
   my $r = shift;
   
  -tie *STDIN, $r unless tied *STDIN;
  +untie *STDIN;
  +tie *STDIN, $r;
   
   while (defined(my $line = STDIN)) {
   $r-puts($line);
  
  
  



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

2001-12-04 Thread dougm

dougm   01/12/04 14:42:29

  Modified:xs/maps  apache_functions.map
  Log:
  properly default next_filter for subrequest methods to r-output_filters-next 
rather than NULL
  
  Revision  ChangesPath
  1.40  +3 -3  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.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- apache_functions.map  2001/11/19 23:46:48 1.39
  +++ apache_functions.map  2001/12/04 22:42:29 1.40
  @@ -71,13 +71,13 @@
ap_sub_req_lookup_dirent
   
   subrequest_rec *:ap_sub_req_lookup_file | | \
  - r, new_file, next_filter=NULL | lookup_file
  + r, new_file, next_filter=r-output_filters-next | lookup_file
   
   subrequest_rec *:ap_sub_req_lookup_uri  | | \
  - r, new_file, next_filter=NULL | lookup_uri
  + r, new_file, next_filter=r-output_filters-next | lookup_uri
   
   subrequest_rec *:ap_sub_req_method_uri  | | \
  - r, method, new_file, next_filter=NULL | lookup_method_uri
  + r, method, new_file, next_filter=r-output_filters-next | lookup_method_uri
   
   PACKAGE=Apache::SubRequest   ISA=Apache::RequestRec
ap_destroy_sub_req  | | r | DESTROY
  
  
  



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

2001-12-04 Thread dougm

dougm   01/12/04 14:43:07

  Modified:src/modules/perl mod_perl.c
  Log:
  flush main output buffer before running a subrequest
  
  Revision  ChangesPath
  1.98  +6 -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.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- mod_perl.c2001/11/24 01:15:01 1.97
  +++ mod_perl.c2001/12/04 22:43:07 1.98
  @@ -368,6 +368,12 @@
   
   modperl_config_req_init(r, rcfg);
   
  +if (r-main) {
  +modperl_config_req_t *main_rcfg =
  +modperl_config_req_get(r-main);
  +modperl_wbucket_flush(main_rcfg-wbucket);
  +}
  +
   return OK;
   }
   
  
  
  



cvs commit: modperl-2.0/t/response/TestAPI lookup_uri2.pm

2001-12-04 Thread dougm

dougm   01/12/04 14:44:29

  Modified:t/api.cvsignore
  Added:   t/response/TestAPI lookup_uri2.pm
  Log:
  add another lookup_uri test that mixes subrequest output with main request output
  
  Revision  ChangesPath
  1.3   +1 -0  modperl-2.0/t/api/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/api/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore2001/11/12 22:39:03 1.2
  +++ .cvsignore2001/12/04 22:44:29 1.3
  @@ -2,6 +2,7 @@
   aplog.t
   conn_rec.t
   lookup_uri.t
  +lookup_uri2.t
   module.t
   request_rec.t
   response.t
  
  
  
  1.1  modperl-2.0/t/response/TestAPI/lookup_uri2.pm
  
  Index: lookup_uri2.pm
  ===
  package TestAPI::lookup_uri2;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::SubRequest ();
  
  sub myplan {
  my $r = shift;
  
  $r-puts(1..3\nok 1\n);
  
  Apache::OK;
  }
  
  sub ok3 {
  my $r = shift;
  
  $r-puts(ok 3\n);
  
  Apache::OK;
  }
  
  sub subrequest {
  my($r, $sub) = @_;
  $r-lookup_uri(join '::', __PACKAGE__, $sub)-run;
  }
  
  sub handler {
  my $r = shift;
  
  subrequest($r, 'myplan');
  
  $r-puts(ok 2\n);
  
  subrequest($r, 'ok3');
  
  Apache::OK;
  }
  
  1;
  __DATA__
  Location /TestAPI::lookup_uri2::myplan
  SetHandler modperl
  PerlResponseHandler TestAPI::lookup_uri2::myplan
  /Location
  
  Location /TestAPI::lookup_uri2::ok3
  SetHandler modperl
  PerlResponseHandler TestAPI::lookup_uri2::ok3
  /Location
  
  
  



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

2001-11-24 Thread dougm

dougm   01/11/23 17:15:02

  Modified:lib/ModPerl Code.pm
   src/modules/perl mod_perl.c mod_perl.h modperl_callback.c
modperl_callback.h
  Log:
  adjust to open_logs and post_config hook prototype changes
  
  Revision  ChangesPath
  1.72  +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.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- Code.pm   2001/11/05 05:19:01 1.71
  +++ Code.pm   2001/11/24 01:15:01 1.72
  @@ -33,7 +33,7 @@
{type = 'server_rec', name = 's'}],
   },
   Files  = {
  -ret  = 'void',
  +ret  = 'int',
   args = [{type = 'apr_pool_t', name = 'pconf'},
{type = 'apr_pool_t', name = 'plog'},
{type = 'apr_pool_t', name = 'ptemp'},
  
  
  
  1.97  +8 -4  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.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- mod_perl.c2001/11/19 00:07:28 1.96
  +++ mod_perl.c2001/11/24 01:15:01 1.97
  @@ -315,14 +315,16 @@
   return APR_SUCCESS;
   }
   
  -void modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
  -   apr_pool_t *ptemp, server_rec *s)
  +int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
  +  apr_pool_t *ptemp, server_rec *s)
   {
   modperl_sys_init();
   apr_pool_cleanup_register(pconf, NULL,
 modperl_sys_term, apr_pool_cleanup_null);
   modperl_init_globals(s, pconf);
   modperl_init(s, pconf);
  +
  +return OK;
   }
   
   void modperl_pre_config_handler(apr_pool_t *p, apr_pool_t *plog,
  @@ -340,8 +342,8 @@
   return OK;
   }
   
  -static void modperl_hook_post_config(apr_pool_t *pconf, apr_pool_t *plog,
  - apr_pool_t *ptemp, server_rec *s)
  +static int modperl_hook_post_config(apr_pool_t *pconf, apr_pool_t *plog,
  +apr_pool_t *ptemp, server_rec *s)
   {
   #ifdef USE_ITHREADS
   MP_dSCFG(s);
  @@ -356,6 +358,8 @@
   #ifdef USE_ITHREADS
   modperl_init_clones(s, pconf);
   #endif
  +
  +return OK;
   }
   
   static int modperl_hook_create_request(request_rec *r)
  
  
  
  1.39  +2 -2  modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- mod_perl.h2001/09/27 19:04:38 1.38
  +++ mod_perl.h2001/11/24 01:15:01 1.39
  @@ -40,8 +40,8 @@
   #include modperl_perl.h
   
   void modperl_init(server_rec *s, apr_pool_t *p);
  -void modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
  -   apr_pool_t *ptemp, server_rec *s);
  +int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
  +  apr_pool_t *ptemp, server_rec *s);
   void modperl_pre_config_handler(apr_pool_t *p, apr_pool_t *plog,
   apr_pool_t *ptemp);
   void modperl_register_hooks(apr_pool_t *p);
  
  
  
  1.47  +6 -6  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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- modperl_callback.c2001/11/05 05:19:01 1.46
  +++ modperl_callback.c2001/11/24 01:15:01 1.47
  @@ -224,11 +224,11 @@
 p, NULL, NULL);
   }
   
  -void modperl_callback_files(int idx,
  -apr_pool_t *pconf, apr_pool_t *plog,
  -apr_pool_t *ptemp, server_rec *s)
  +int modperl_callback_files(int idx,
  +   apr_pool_t *pconf, apr_pool_t *plog,
  +   apr_pool_t *ptemp, server_rec *s)
   {
  -modperl_callback_run_handlers(idx, MP_HANDLER_TYPE_FILES,
  -  NULL, NULL, s,
  -  pconf, plog, ptemp);
  +return modperl_callback_run_handlers(idx, MP_HANDLER_TYPE_FILES,
  + NULL, NULL, s,
  + pconf, plog, ptemp);
   }
  
  
  
  1.20  +3 -3  modperl-2.0/src/modules/perl/modperl_callback.h
  
  Index: modperl_callback.h
  ===
  RCS file

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

2001-11-20 Thread dougm

dougm   01/11/20 18:13:00

  Modified:lib/ModPerl BuildOptions.pm
  Log:
  add missing LIBNAME option to the table
  
  Revision  ChangesPath
  1.12  +1 -0  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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BuildOptions.pm   2001/10/20 18:59:28 1.11
  +++ BuildOptions.pm   2001/11/21 02:13:00 1.12
  @@ -164,3 +164,4 @@
   XS_GLUE_DIR Directories containing extension glue
   INCLUDE_DIR Add directories to search for header files
   GENERATE_XS Generate XS code based on httpd version
  +LIBNAME Name of the modperl dso library (default is libmodperl)
  
  
  



cvs commit: modperl-2.0/xs/Apache/Connection - New directory

2001-11-19 Thread dougm

dougm   01/11/19 09:32:03

  modperl-2.0/xs/Apache/Connection - New directory



cvs commit: modperl-2.0/xs/Apache/Connection Apache__Connection.h

2001-11-19 Thread dougm

dougm   01/11/19 09:32:46

  Added:   xs/Apache/Connection Apache__Connection.h
  Log:
  the new client_socket code
  
  Revision  ChangesPath
  1.1  modperl-2.0/xs/Apache/Connection/Apache__Connection.h
  
  Index: Apache__Connection.h
  ===
  static MP_INLINE
  apr_socket_t *mpxs_Apache__Connection_client_socket(pTHX_ conn_rec *c,
  apr_socket_t *s)
  {
  apr_socket_t *socket =
  ap_get_module_config(c-conn_config, core_module);
  
  if (s) {
  ap_set_module_config(c-conn_config, core_module, s);
  }
  
  return socket;
  }
  
  
  



cvs commit: modperl-2.0/t/directive setupenv.t

2001-11-19 Thread dougm

dougm   01/11/19 10:23:20

  Modified:t/directive setupenv.t
  Log:
  remove debug prints (-d lwp gives plenty)
  
  Revision  ChangesPath
  1.2   +1 -3  modperl-2.0/t/directive/setupenv.t
  
  Index: setupenv.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/directive/setupenv.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- setupenv.t2001/11/19 00:14:53 1.1
  +++ setupenv.t2001/11/19 18:23:20 1.2
  @@ -12,7 +12,7 @@
   my $env = GET_BODY $location;
   
   ok $env;
  -print $env;
  +
   my %env;
   
   for my $line (split /\n/, $env) {
  @@ -20,8 +20,6 @@
   my($key, $val) = split /=/, $line, 2;
   $env{$key} = $val || '';
   }
  -use Data::Dumper;
  -print Dumper \%env;
   
   ok t_cmp $location, $env{REQUEST_URI}, testing REQUEST_URI;
   
  
  
  



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

2001-11-19 Thread dougm

dougm   01/11/19 15:24:46

  Modified:src/modules/perl modperl_util.c
  Log:
  give modperl_sv2pool more to choose from
  
  Revision  ChangesPath
  1.31  +28 -10modperl-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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- modperl_util.c2001/11/06 18:39:41 1.30
  +++ modperl_util.c2001/11/19 23:24:46 1.31
  @@ -170,15 +170,21 @@
   
   apr_pool_t *modperl_sv2pool(pTHX_ SV *obj)
   {
  -char *classname;
  +apr_pool_t *p = NULL;
  +char *classname = NULL;
  +IV ptr = 0;
   
  -if (!(SvROK(obj)  (SvTYPE(SvRV(obj)) == SVt_PVMG))) {
  -return NULL;
  +if ((SvROK(obj)  (SvTYPE(SvRV(obj)) == SVt_PVMG))) {
  +ptr = SvObjIV(obj);
  +classname = SvCLASS(obj);
   }
  -
  -classname = SvCLASS(obj);
  +else {
  +STRLEN len;
  +classname = SvPV(obj, len);
  +}
   
   if (*classname != 'A') {
  +/* XXX: could be a subclass */
   return NULL;
   }
   
  @@ -187,25 +193,37 @@
   switch (*classname) {
 case 'P':
   if (strEQ(classname, Pool)) {
  -return (apr_pool_t *)SvObjIV(obj);
  +p = (apr_pool_t *)ptr;
   }
  +break;
 default:
  -return NULL;
  +break;
   };
   }
   else if (strnEQ(classname, Apache::, 8)) {
   classname += 8;
   switch (*classname) {
  +  case 'C':
  +if (strEQ(classname, Connection)) {
  +p = ptr ? ((conn_rec *)ptr)-pool : NULL;
  +}
  +break;
 case 'R':
   if (strEQ(classname, RequestRec)) {
  -return ((request_rec *)SvObjIV(obj))-pool;
  +p = ptr ? ((request_rec *)ptr)-pool : NULL;
  +}
  +break;
  +  case 'S':
  +if (strEQ(classname, Server)) {
  +p = ptr ? ((server_rec *)ptr)-process-pconf : NULL;
   }
  +break;
 default:
  -return NULL;
  +break;
   };
   }
   
  -return NULL;
  +return p ? p : modperl_global_get_pconf();
   }
   
   char *modperl_apr_strerror(apr_status_t rv)
  
  
  



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

2001-11-19 Thread dougm

dougm   01/11/19 15:32:00

  Modified:xs/Apache/ServerUtil Apache__ServerUtil.h
   xs/maps  apache_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  fix Apache::server_root_relative arguments to be the same as apache api
  
  use modperl_sv2pool() to find the apr_pool_t *
  
  Revision  ChangesPath
  1.7   +3 -11 modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h
  
  Index: Apache__ServerUtil.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/ServerUtil/Apache__ServerUtil.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Apache__ServerUtil.h  2001/11/12 22:42:28 1.6
  +++ Apache__ServerUtil.h  2001/11/19 23:32:00 1.7
  @@ -43,18 +43,10 @@
   modperl_global_get_server_rec()
   
   static MP_INLINE char *mpxs_ap_server_root_relative(pTHX_
  -const char *fname,
  -apr_pool_t *p)
  +SV *sv,
  +const char *fname)
   {
  -if (!fname) {
  -fname = ;
  -}
  +apr_pool_t *p = modperl_sv2pool(aTHX_ sv);
   
  -if (!p) {
  -/* XXX: should do something better if called at request time
  - * without a pool
  - */
  -p = modperl_global_get_pconf();
  -}
   return ap_server_root_relative(p, fname);
   }
  
  
  
  1.38  +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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- apache_functions.map  2001/11/12 22:42:28 1.37
  +++ apache_functions.map  2001/11/19 23:32:00 1.38
  @@ -152,7 +152,7 @@
ap_get_server_built
ap_get_server_version
ap_psignature | | r,prefix
  - ap_server_root_relative | mpxs_ | fname=NULL, p=NULL
  + ap_server_root_relative | mpxs_ | SV *:p, fname=
   
   MODULE=Apache::Connection   PACKAGE=guess
ap_get_remote_host
  
  
  
  1.52  +5 -5  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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- FunctionTable.pm  2001/11/19 22:40:12 1.51
  +++ FunctionTable.pm  2001/11/19 23:32:00 1.52
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Nov 19 14:57:48 2001
  +# !  Mon Nov 19 15:11:46 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -4827,12 +4827,12 @@
   'name' = 'my_perl'
 },
 {
  -'type' = 'const char *',
  -'name' = 'fname'
  +'type' = 'SV *',
  +'name' = 'sv'
 },
 {
  -'type' = 'apr_pool_t *',
  -'name' = 'p'
  +'type' = 'const char *',
  +'name' = 'fname'
 }
   ]
 },
  
  
  



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

2001-11-19 Thread dougm

dougm   01/11/19 15:33:21

  Modified:lib/Apache compat.pm
  Log:
  add support for 1.x style $r-server_root_relative
  
  Revision  ChangesPath
  1.24  +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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- compat.pm 2001/11/08 03:19:47 1.23
  +++ compat.pm 2001/11/19 23:33:21 1.24
  @@ -78,6 +78,9 @@
   
   package Apache::RequestRec;
   
  +#to support $r-server_root_relative
  +*server_root_relative = \Apache::server_root_relative;
  +
   #we support Apache-request; this is needed to support $r-request
   #XXX: seems sorta backwards
   *request = \Apache::request;
  
  
  



cvs commit: modperl-2.0/t/response/TestAPI server_util.pm

2001-11-19 Thread dougm

dougm   01/11/19 15:47:24

  Modified:t/response/TestAPI server_util.pm
  Log:
  add tests for Apache::server_root constant
  
  Revision  ChangesPath
  1.4   +10 -2 modperl-2.0/t/response/TestAPI/server_util.pm
  
  Index: server_util.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_util.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- server_util.pm2001/11/19 23:32:27 1.3
  +++ server_util.pm2001/11/19 23:47:24 1.4
  @@ -14,7 +14,7 @@
   
   my $s = $r-server;
   
  -plan $r, tests = 7;
  +plan $r, tests = 9;
   
   for my $p ($r-pool, $r-connection-pool,
  $r, $r-connection, $r-server)
  @@ -24,7 +24,15 @@
   ok -d $dir;
   }
   
  -my $dir = Apache-server_root_relative('logs'); #1.x ish
  +my $dir = Apache::server_root; #constant
  +
  +ok -d $dir;
  +
  +$dir = join '/', Apache::server_root, 'logs';
  +
  +ok $dir eq Apache::server_root_relative($r-pool, 'logs');
  +
  +$dir = Apache-server_root_relative('logs'); #1.x ish
   
   ok -d $dir;
   
  
  
  



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

2001-11-18 Thread dougm

dougm   01/11/18 16:13:55

  Added:   t/directive .cvsignore
   t/response/TestDirective env.pm
  Log:
  add tests for Perl{Set,Pass}Env
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/directive/.cvsignore
  
  Index: .cvsignore
  ===
  env.t
  
  
  
  1.1  modperl-2.0/t/response/TestDirective/env.pm
  
  Index: env.pm
  ===
  package TestDirective::env;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Const -compile = 'OK';
  use Apache::Test;
  use Apache::TestUtil;
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 4;
  
  ok t_cmp('env_dir1', env_get('srv1'),
   'per-dir override per-srv');
  
  ok t_cmp('env_srv2', env_get('srv2'),
   'per-srv');
  
  ok t_cmp('env_dir2', env_get('dir2'),
   'per-dir');
  
  #setup by Apache::TestRun
  ok t_cmp('test.host.name',
   $ENV{APACHE_TEST_HOSTNAME},
   'PassEnv');
  
  Apache::OK;
  }
  
  sub env_get {
  my($name, $r) = @_;
  my $key = 'TestDirective__env_' . $name;
  return $r ? $r-subprocess_env-get($key) : $ENV{$key};
  }
  
  1;
  __END__
  PerlOptions +SetupEnv
  
  Base
  PerlSetEnv TestDirective__env_srv1 env_srv1
  
  PerlSetEnv TestDirective__env_srv2 env_srv2
  
  PerlPassEnv APACHE_TEST_HOSTNAME
  /Base
  
  PerlSetEnv TestDirective__env_srv1 env_dir1
  
  PerlSetEnv TestDirective__env_dir2 ToBeLost
  PerlSetEnv TestDirective__env_dir2 env_dir2
  
  
  
  



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

2001-11-18 Thread dougm

dougm   01/11/18 16:21:25

  Modified:src/modules/perl modperl_config.c
  Log:
  moving merge_table_overlap_item macro logic into a function
  
  Revision  ChangesPath
  1.49  +24 -15modperl-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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- modperl_config.c  2001/11/19 00:07:28 1.48
  +++ modperl_config.c  2001/11/19 00:21:25 1.49
  @@ -18,22 +18,31 @@
   mrg-item = add-item ? add-item : base-item
   
   /* take the 'base' values, and override with 'add' values if any */
  -#define merge_table_overlap_item(item) \
  -{ \
  -const apr_array_header_t *arr = apr_table_elts(base-item); \
  -apr_table_entry_t *entries  = (apr_table_entry_t *)arr-elts; \
  -int i; \
  -mrg-item = apr_table_copy(p, add-item); \
  -for (i = 0; i  arr-nelts; i++) { \
  -char *val; \
  -if ((val = (char *)apr_table_get(add-item, entries[i].key))){ \
  -continue; \
  -} \
  -else if ((val = (char *)apr_table_get(base-item, entries[i].key))){ \
  -apr_table_set(mrg-item, entries[i].key, val); \
  -} \
  -} \
  +static apr_table_t *modperl_table_overlap(apr_pool_t *p,
  +  apr_table_t *base,
  +  apr_table_t *add)
  +{
  +int i;
  +const apr_array_header_t *arr = apr_table_elts(base);
  +apr_table_entry_t *entries  = (apr_table_entry_t *)arr-elts;
  +apr_table_t *merge = apr_table_copy(p, add);
  +
  +for (i = 0; i  arr-nelts; i++) {
  +char *val;
  +
  +if ((val = (char *)apr_table_get(add, entries[i].key))) {
  +continue;
  +}
  +else if ((val = (char *)apr_table_get(base, entries[i].key))){
  +apr_table_set(merge, entries[i].key, val);
  +}
   }
  +
  +return merge;
  +}
  +
  +#define merge_table_overlap_item(item) \
  +mrg-item = modperl_table_overlap(p, base-item, add-item)
   
   #define merge_handlers(merge_flag, array) \
   if (merge_flag(mrg)) { \
  
  
  



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

2001-11-18 Thread dougm

dougm   01/11/18 16:33:37

  Modified:src/modules/perl modperl_config.c
  Log:
  avoid get on the base table in modperl_table_overlap() since we already have the 
value
  
  Revision  ChangesPath
  1.50  +6 -5  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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- modperl_config.c  2001/11/19 00:21:25 1.49
  +++ modperl_config.c  2001/11/19 00:33:37 1.50
  @@ -28,13 +28,14 @@
   apr_table_t *merge = apr_table_copy(p, add);
   
   for (i = 0; i  arr-nelts; i++) {
  -char *val;
  -
  -if ((val = (char *)apr_table_get(add, entries[i].key))) {
  +if (apr_table_get(add, entries[i].key)) {
   continue;
   }
  -else if ((val = (char *)apr_table_get(base, entries[i].key))){
  -apr_table_set(merge, entries[i].key, val);
  +else {
  +/*XXX: should setn() be addn()for PerlSetVar?
  + * since we have PerlAddVar, there may be multiple values.
  + */
  +apr_table_setn(merge, entries[i].key, entries[i].val);
   }
   }
   
  
  
  



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

2001-11-15 Thread dougm

dougm   01/11/15 09:52:00

  Modified:xs/tables/current/Apache ConstantsTable.pm FunctionTable.pm
StructureTable.pm
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.17  +1 -1  modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm
  
  Index: ConstantsTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ConstantsTable.pm 2001/11/12 22:17:02 1.16
  +++ ConstantsTable.pm 2001/11/15 17:52:00 1.17
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Mon Nov 12 14:22:14 2001
  +# !  Thu Nov 15 09:53:52 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  
  
  
  1.26  +119 -1modperl-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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- FunctionTable.pm  2001/11/12 22:17:02 1.25
  +++ FunctionTable.pm  2001/11/15 17:52:00 1.26
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Mon Nov 12 14:22:23 2001
  +# !  Thu Nov 15 09:45:53 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -1463,6 +1463,28 @@
 },
 {
   'return_type' = 'void',
  +'name' = 'ap_hook_create_connection',
  +'args' = [
  +  {
  +'type' = 'ap_HOOK_create_connection_t *',
  +'name' = 'pf'
  +  },
  +  {
  +'type' = 'const char * const *',
  +'name' = 'aszPre'
  +  },
  +  {
  +'type' = 'const char * const *',
  +'name' = 'aszSucc'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'nOrder'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
   'name' = 'ap_hook_create_request',
   'args' = [
 {
  @@ -1571,6 +1593,11 @@
 },
 {
   'return_type' = 'apr_array_header_t *',
  +'name' = 'ap_hook_get_create_connection',
  +'args' = []
  +  },
  +  {
  +'return_type' = 'apr_array_header_t *',
   'name' = 'ap_hook_get_create_request',
   'args' = []
 },
  @@ -2323,6 +2350,11 @@
   ]
 },
 {
  +'return_type' = 'void',
  +'name' = 'ap_listen_pre_config',
  +'args' = []
  +  },
  +  {
   'return_type' = 'int',
   'name' = 'ap_location_walk',
   'args' = [
  @@ -3789,6 +3821,28 @@
   ]
 },
 {
  +'return_type' = 'conn_rec *',
  +'name' = 'ap_run_create_connection',
  +'args' = [
  +  {
  +'type' = 'apr_pool_t *',
  +'name' = 'p'
  +  },
  +  {
  +'type' = 'server_rec *',
  +'name' = 'server'
  +  },
  +  {
  +'type' = 'apr_socket_t *',
  +'name' = 'csd'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'conn_id'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'int',
   'name' = 'ap_run_create_request',
   'args' = [
  @@ -4449,6 +4503,42 @@
 },
 {
   'return_type' = 'const char *',
  +'name' = 'ap_set_listenbacklog',
  +'args' = [
  +  {
  +'type' = 'cmd_parms *',
  +'name' = 'cmd'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'dummy'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'arg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'const char *',
  +'name' = 'ap_set_listener',
  +'args' = [
  +  {
  +'type' = 'cmd_parms *',
  +'name' = 'cmd'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'dummy'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'ips'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'const char *',
   'name' = 'ap_set_name_virtual_host',
   'args' = [
 {
  @@ -4467,6 +4557,24 @@
 },
 {
   'return_type' = 'const char *',
  +'name' = 'ap_set_send_buffer_size',
  +'args' = [
  +  {
  +'type' = 'cmd_parms *',
  +'name' = 'cmd'
  +  },
  +  {
  +'type' = 'void *',
  +'name' = 'dummy'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'arg'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'const char *',
   'name' = 'ap_set_string_slot',
   'args' = [
 {
  @@ -4526,6 +4634,16

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

2001-11-14 Thread dougm

dougm   01/11/14 17:30:46

  Modified:src/modules/perl mod_perl.c
  Log:
  save globals before populating %ENV vars
  
  Revision  ChangesPath
  1.94  +2 -2  modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- mod_perl.c2001/11/01 23:50:32 1.93
  +++ mod_perl.c2001/11/15 01:30:45 1.94
  @@ -524,6 +524,8 @@
   }
   #endif
   
  +modperl_perl_global_request_save(aTHX_ r);
  +
   /* default is +SetupEnv, skip if PerlOption -SetupEnv */
   if (MpDirSETUP_ENV(dcfg) || !MpDirSeenSETUP_ENV(dcfg)) {
   modperl_env_request_populate(aTHX_ r);
  @@ -532,8 +534,6 @@
   if (MpDirPARSE_HEADERS(dcfg)) {
   rcfg-wbucket.header_parse = 1;
   }
  -
  -modperl_perl_global_request_save(aTHX_ r);
   
   h_stdout = modperl_io_tie_stdout(aTHX_ r);
   h_stdin  = modperl_io_tie_stdin(aTHX_ r);
  
  
  



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

2001-11-14 Thread dougm

dougm   01/11/14 19:02:43

  Modified:src/modules/perl mod_perl.c modperl_env.c modperl_env.h
   t/conf   modperl_extra.pl
   t/modperl .cvsignore
  Log:
  more complete implementation of tie %ENV to r-subprocess_env
  
  Revision  ChangesPath
  1.95  +2 -7  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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- mod_perl.c2001/11/15 01:30:45 1.94
  +++ mod_perl.c2001/11/15 03:02:42 1.95
  @@ -147,6 +147,8 @@
   return;
   }
   
  +modperl_env_init();
  +
   base_perl = modperl_startup(base_server, p);
   
   #ifdef USE_ITHREADS
  @@ -538,21 +540,14 @@
   h_stdout = modperl_io_tie_stdout(aTHX_ r);
   h_stdin  = modperl_io_tie_stdin(aTHX_ r);
   
  -#if 0
  -/* current implementation of tie %ENV to $r-subprocess_env 
  - * is not threadsafe
  - */
   modperl_env_request_tie(aTHX_ r);
  -#endif
   
   retval = modperl_response_handler_run(r, FALSE);
   
   modperl_io_handle_untie(aTHX_ h_stdout);
   modperl_io_handle_untie(aTHX_ h_stdin);
   
  -#if 0
   modperl_env_request_untie(aTHX_ r);
  -#endif
   
   modperl_perl_global_request_restore(aTHX_ r);
   
  
  
  
  1.19  +150 -41   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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- modperl_env.c 2001/11/12 22:14:36 1.18
  +++ modperl_env.c 2001/11/15 03:02:43 1.19
  @@ -1,6 +1,7 @@
   #include mod_perl.h
   
   #define EnvMgObj SvMAGIC((SV*)ENVHV)-mg_ptr
  +#define EnvMgLen SvMAGIC((SV*)ENVHV)-mg_len
   
   static MP_INLINE
   void modperl_env_hv_store(pTHX_ HV *hv, apr_table_entry_t *elt)
  @@ -87,7 +88,6 @@
   const apr_array_header_t *array;
   apr_table_entry_t *elts;
   
  -
   if (MpReqSETUP_ENV(rcfg)) {
   return;
   }
  @@ -118,69 +118,178 @@
   MpReqSETUP_ENV_On(rcfg);
   }
   
  -static int modperl_env_request_set(pTHX_ SV *sv, MAGIC *mg)
  +void modperl_env_request_tie(pTHX_ request_rec *r)
   {
  -const char *key, *val;
  -STRLEN klen, vlen;
  -request_rec *r = (request_rec *)EnvMgObj;
  +EnvMgObj = (char *)r;
  +EnvMgLen = -1;
  +
  +#ifdef MP_PERL_HV_GMAGICAL_AWARE
  +SvGMAGICAL_on((SV*)ENVHV);
  +#endif
  +}
  +
  +void modperl_env_request_untie(pTHX_ request_rec *r)
  +{
  +EnvMgObj = NULL;
  +
  +#ifdef MP_PERL_HV_GMAGICAL_AWARE
  +SvGMAGICAL_off((SV*)ENVHV);
  +#endif
  +}
  +
  +/* to store the original virtual tables
  + * these are global, not per-interpreter
  + */
  +static MGVTBL MP_PERL_vtbl_env;
  +static MGVTBL MP_PERL_vtbl_envelem;
   
  -key = (const char *)MgPV(mg,klen);
  -val = (const char *)SvPV(sv,vlen);
  +#define MP_PL_vtbl_call(name, meth) \
  +MP_PERL_vtbl_##name.svt_##meth(aTHX_ sv, mg)
   
  -apr_table_set(r-subprocess_env, key, val);
  +#define MP_dENV_KEY \
  +STRLEN klen; \
  +const char *key = (const char *)MgPV(mg,klen)
  +
  +#define MP_dENV_VAL \
  +STRLEN vlen; \
  +const char *val = (const char *)SvPV(sv,vlen)
   
  -/*return magic_setenv(sv, mg);*/
  +/*
  + * XXX: what we do here might change:
  + *  - make it optional for %ENV to be tied to r-subprocess_env
  + *  - make it possible to modify environ
  + *  - we could allow modification of environ if mpm isn't threaded
  + *  - we could allow modification of environ if variable isn't a CGI
  + *variable (still could cause problems)
  + */
  +/*
  + * problems we are trying to solve:
  + *  - environ is shared between threads
  + *  + Perl does not serialize access to environ
  + *  + even if it did, CGI variables cannot be shared between threads!
  + * problems we create by trying to solve above problems:
  + *  - a forked process will not inherit the current %ENV
  + *  - C libraries might rely on environ, e.g. DBD::Oracle
  + */
  +static int modperl_env_magic_set_all(pTHX_ SV *sv, MAGIC *mg)
  +{
  +request_rec *r = (request_rec *)EnvMgObj;
   
  +if (r) {
  +if (PL_localizing) {
  +/* local %ENV = (FOO = 'bar', BIZ = 'baz') */
  +HE *entry;
  +STRLEN n_a;
  +
  +hv_iterinit((HV*)sv);
  +while ((entry = hv_iternext((HV*)sv))) {
  +I32 keylen;
  +apr_table_set(r-subprocess_env,
  +  hv_iterkey(entry, keylen),
  +  SvPV(hv_iterval((HV*)sv, entry), n_a));
  +}
  +}
  +}
  +else {
  +return MP_PL_vtbl_call(env

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

2001-11-14 Thread dougm

dougm   01/11/14 19:03:22

  Added:   t/response/TestModperl env.pm
  Log:
  add test for tie of %ENV to r-subprocess_env
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/response/TestModperl/env.pm
  
  Index: env.pm
  ===
  package TestModperl::env;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::Const -compile = 'OK';
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 20;
  
  my $env = $r-subprocess_env;
  
  ok $ENV{MODPERL_EXTRA_PL}; #set in t/conf/modperl_extra.pl
  ok $ENV{MOD_PERL};
  
  $ENV{FOO} = 2;
  ok $ENV{FOO} == 2;
  ok $env-get('FOO') == 2;
  
  $ENV{FOO}++;
  ok $ENV{FOO} == 3;
  ok $env-get('FOO') == 3;
  
  $ENV{FOO} .= 6;
  ok $ENV{FOO} == 36;
  ok $env-get('FOO') == 36;
  
  delete $ENV{FOO};
  ok ! $ENV{FOO};
  ok ! $env-get('FOO');
  
  ok $ENV{SERVER_SOFTWARE};
  ok $env-get('SERVER_SOFTWARE');
  
  {
  local %ENV = (FOO = 1, BAR = 2);
  
  ok $ENV{FOO} == 1;
  ok $env-get('FOO') == 1;
  
  ok ! $ENV{SERVER_SOFTWARE};
  ok ! $env-get('SERVER_SOFTWARE');
  }
  
  ok ! $ENV{FOO};
  #ok ! $env-get('FOO');
  #XXX: keys in the original subprocess_env are restored
  # but new ones added to the local %ENV are not removed
  # after the local %ENV goes out of scope
  #skip r-subprocess_env + local() doesnt fully work yet, 1;
  ok 1; #the skip() message is just annoying
  
  ok $ENV{SERVER_SOFTWARE};
  ok $env-get('SERVER_SOFTWARE');
  
  Apache::OK;
  }
  
  1;
  __END__
  SetHandler perl-script
  
  
  



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

2001-11-13 Thread dougm

dougm   01/11/13 09:42:49

  Modified:t/response/TestAPI request_rec.pm
   todo api.txt
   xs/Apache/RequestUtil Apache__RequestUtil.h
   xs/maps  modperl_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  implement $r-pnotes
  Submitted by: Philippe M. Chiasson [EMAIL PROTECTED]
  Reviewed by:  dougm
  
  Revision  ChangesPath
  1.10  +11 -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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- request_rec.pm2001/10/29 01:19:16 1.9
  +++ request_rec.pm2001/11/13 17:42:49 1.10
  @@ -11,7 +11,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 49;
  +plan $r, tests = 54;
   
   #Apache-request($r); #PerlOptions +GlobalRequest takes care
   my $gr = Apache-request;
  @@ -78,6 +78,16 @@
   ok $r-subprocess_env;
   
   ok $r-notes;
  +
  +ok $r-pnotes;
  + 
  +ok t_cmp('pnotes_bar', $r-pnotes('pnotes_foo','pnotes_bar'), 
qq{\$r-pnotes(key,val)});
  +
  +ok t_cmp(pnotes_bar, $r-pnotes('pnotes_foo') , qq{\$r-pnotes(key)});
  +
  +ok t_cmp('HASH', ref($r-pnotes), qq{ref($r-pnotes)});
  +
  +ok t_cmp('pnotes_bar', $r-pnotes()-{'pnotes_foo'}, qq{\$r-pnotes()-{}});
   
   ok $r-content_type;
   
  
  
  
  1.16  +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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- api.txt   2001/11/08 03:19:48 1.15
  +++ api.txt   2001/11/13 17:42:49 1.16
  @@ -10,9 +10,6 @@
   need apr_finfo_t - struct stat conversion (might already be there,
   haven't looked close enough yet)
   
  -$r-pnotes:
  -not yet implemented
  -
   $r-subprocess_env:
   in void context should populate %ENV as 1.x does
   
  
  
  
  1.11  +32 -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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Apache__RequestUtil.h 2001/11/07 03:39:08 1.10
  +++ Apache__RequestUtil.h 2001/11/13 17:42:49 1.11
  @@ -172,6 +172,38 @@
   return retval;
   }
   
  +static MP_INLINE
  +SV *mpxs_Apache__RequestRec_pnotes(pTHX_ request_rec *r, SV *key, SV *val)
  +{
  +MP_dRCFG;
  +SV *retval = NULL;
  +
  +if (!rcfg) {
  +return PL_sv_undef;
  +}
  +if (!rcfg-pnotes) {
  +rcfg-pnotes = newHV();
  +}
  +
  +if (key) {
  +STRLEN len;
  +char *k = SvPV(key, len);
  +
  +if (val) {
  +retval = *hv_store(rcfg-pnotes, k, len,
  +   SvREFCNT_inc(val), 0);
  +}
  +else if (hv_exists(rcfg-pnotes, k, len)) {
  +retval = *hv_fetch(rcfg-pnotes, k, len, FALSE);
  +}
  +}
  +else {
  +retval = newRV_inc((SV *)rcfg-pnotes);
  +}
  +
  +return retval ? SvREFCNT_inc(retval) : PL_sv_undef;
  +}
  +
   #define mpxs_Apache__RequestRec_dir_config(r, key, sv_val) \
   modperl_dir_config(aTHX_ r, r-server, key, sv_val)
   
  
  
  
  1.28  +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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- modperl_functions.map 2001/11/07 04:03:07 1.27
  +++ modperl_functions.map 2001/11/13 17:42:49 1.28
  @@ -13,6 +13,7 @@
mpxs_Apache__RequestRec_set_handlers
mpxs_Apache__RequestRec_get_handlers
mpxs_Apache__RequestRec_location
  + mpxs_Apache__RequestRec_pnotes | | r, key=Nullsv, val=Nullsv
   
#protocol module helpers
mpxs_Apache__RequestRec_location_merge
  
  
  
  1.48  +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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- FunctionTable.pm  2001/11/12 22:38:27 1.47
  +++ FunctionTable.pm  2001/11/13 17:42:49 1.48
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by ModPerl::ParseSource/0.01
  -# !  Mon Nov 12 14:44:40 2001
  +# !  Tue Nov 13 09:47:37 2001
   # !  do

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

2001-11-13 Thread dougm

dougm   01/11/13 10:09:19

  Modified:t/modperl .cvsignore
   t/response/TestAPI request_rec.pm
  Added:   t/response/TestModperl pnotes.pm
  Log:
  giving pnotes its own test
  
  Revision  ChangesPath
  1.5   +1 -0  modperl-2.0/t/modperl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/modperl/.cvsignore,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- .cvsignore2001/11/06 18:50:25 1.4
  +++ .cvsignore2001/11/13 18:09:19 1.5
  @@ -2,3 +2,4 @@
   exit.t
   printf.t
   print.t
  +pnotes.t
  
  
  
  1.11  +1 -11 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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- request_rec.pm2001/11/13 17:42:49 1.10
  +++ request_rec.pm2001/11/13 18:09:19 1.11
  @@ -11,7 +11,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 54;
  +plan $r, tests = 49;
   
   #Apache-request($r); #PerlOptions +GlobalRequest takes care
   my $gr = Apache-request;
  @@ -78,16 +78,6 @@
   ok $r-subprocess_env;
   
   ok $r-notes;
  -
  -ok $r-pnotes;
  - 
  -ok t_cmp('pnotes_bar', $r-pnotes('pnotes_foo','pnotes_bar'), 
qq{\$r-pnotes(key,val)});
  -
  -ok t_cmp(pnotes_bar, $r-pnotes('pnotes_foo') , qq{\$r-pnotes(key)});
  -
  -ok t_cmp('HASH', ref($r-pnotes), qq{ref($r-pnotes)});
  -
  -ok t_cmp('pnotes_bar', $r-pnotes()-{'pnotes_foo'}, qq{\$r-pnotes()-{}});
   
   ok $r-content_type;
   
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/pnotes.pm
  
  Index: pnotes.pm
  ===
  package TestModperl::pnotes;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::Const -compile = 'OK';
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 5;
  
  ok $r-pnotes;
  
  ok t_cmp('pnotes_bar',
   $r-pnotes('pnotes_foo', 'pnotes_bar'),
   q{$r-pnotes(key,val)});
  
  ok t_cmp('pnotes_bar',
   $r-pnotes('pnotes_foo'),
   q{$r-pnotes(key)});
  
  ok t_cmp('HASH', ref($r-pnotes), q{ref($r-pnotes)});
  
  ok t_cmp('pnotes_bar', $r-pnotes()-{'pnotes_foo'},
   q{$r-pnotes()-{}});
  
  Apache::OK;
  }
  
  1;
  __END__
  
  
  
  
  



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

2001-11-13 Thread dougm

dougm   01/11/13 10:35:08

  Modified:t/modperl .cvsignore
   t/response/TestAPI request_rec.pm server_rec.pm
  Added:   t/response/TestModperl dir_config.pm
  Log:
  giving dir_config its own test
  
  Revision  ChangesPath
  1.6   +1 -0  modperl-2.0/t/modperl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/modperl/.cvsignore,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- .cvsignore2001/11/13 18:09:19 1.5
  +++ .cvsignore2001/11/13 18:35:08 1.6
  @@ -3,3 +3,4 @@
   printf.t
   print.t
   pnotes.t
  +dir_config.t
  
  
  
  1.12  +1 -96 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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- request_rec.pm2001/11/13 18:09:19 1.11
  +++ request_rec.pm2001/11/13 18:35:08 1.12
  @@ -11,7 +11,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 49;
  +plan $r, tests = 41;
   
   #Apache-request($r); #PerlOptions +GlobalRequest takes care
   my $gr = Apache-request;
  @@ -89,81 +89,6 @@
   
   #user
   
  -#- dir_config tests -#
  -
  -# this test doesn't test all $r-dir_config-*(), since
  -# dir_config() returns a generic APR::Table which is tested in
  -# apr/table.t.
  -
  -# object test
  -my $dir_config = $r-dir_config;
  -ok defined $dir_config  ref($dir_config) eq 'APR::Table';
  -
  -# PerlAddVar ITERATE2 test
  -{
  -my $key = make_key('1');
  -my @received = $dir_config-get($key);
  -my @expected = qw(1_SetValue 2_AddValue 3_AddValue 4_AddValue);
  -ok t_cmp(
  - \@expected,
  - \@received,
  - testing PerlAddVar ITERATE2,
  -)
  -}
  -
  -{
  -my $key = make_key('0');
  -
  -# object interface test in a scalar context (for a single
  -# PerlSetVar key)
  -ok t_cmp(SetValue0,
  - $dir_config-get($key),
  - qq{\$dir_config-get($key)});
  -
  -#  direct fetch test in a scalar context (for a single
  -#  PerlSetVar)
  -ok t_cmp(SetValue0,
  - $r-dir_config($key),
  - qq{\$r-dir_config($key)});
  -}
  -
  -# test non-existent key
  -{
  -my $key = make_key();
  -ok t_cmp(undef,
  - $r-dir_config($key),
  - qq{\$r-dir_config($key)});
  -}
  -
  -# test set interface
  -{
  -my $key = make_key();
  -my $val = DirConfig;
  -$r-dir_config($key = $val);
  -ok t_cmp($val,
  - $r-dir_config($key),
  - qq{\$r-dir_config($key = $val)});
  -}
  -
  -# test unset interface
  -{
  -my $key = make_key();
  -$r-dir_config($key = 'whatever');
  -$r-dir_config($key = undef);
  -ok t_cmp(undef,
  - $r-dir_config($key),
  - qq{\$r-dir_config($key = undef)});
  -}
  -
  -# test PerlSetVar set in base config
  -{
  -my $key = make_key('_set_in_Base');
  -ok t_cmp(BaseValue,
  - $r-dir_config($key),
  - qq{\$r-dir_config($key)});
  -}
  -
  -#no_cache
   ok $r-no_cache || 1;
   
   {
  @@ -209,26 +134,6 @@
   Apache::OK;
   }
   
  -my $key_base = TestAPI__request_rec_Key;
  -my $counter  = 0;
  -sub make_key{
  -return $key_base .
  -(defined $_[0]
  -? $_[0]
  -: unpack H*, pack n, ++$counter . rand(100) );
  -}
   1;
   __END__
  -Base
  -PerlSetVar TestAPI__request_rec_Key_set_in_Base BaseValue
  -/Base
   PerlOptions +GlobalRequest
  -
  -PerlSetVar TestAPI__request_rec_Key0 SetValue0
  -
  -
  -PerlSetVar TestAPI__request_rec_Key1 ToBeLost
  -PerlSetVar TestAPI__request_rec_Key1 1_SetValue
  -PerlAddVar TestAPI__request_rec_Key1 2_AddValue
  -PerlAddVar TestAPI__request_rec_Key1 3_AddValue 4_AddValue
  -
  
  
  
  1.6   +1 -47 modperl-2.0/t/response/TestAPI/server_rec.pm
  
  Index: server_rec.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_rec.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- server_rec.pm 2001/10/10 02:55:15 1.5
  +++ server_rec.pm 2001/11/13 18:35:08 1.6
  @@ -14,7 +14,7 @@
   
   my $s = $r-server;
   
  -plan $r, tests = 21;
  +plan $r, tests = 17;
   
   ok $s;
   
  @@ -60,46 +60,6 @@
   
   ok $s-limit_req_fields;
   
  -
  -#- dir_config tests

cvs commit: modperl-2.0/t/response/TestAPI conn_rec.pm request_rec.pm server_rec.pm

2001-11-13 Thread dougm

dougm   01/11/13 10:40:01

  Modified:t/response/TestAPI conn_rec.pm request_rec.pm server_rec.pm
  Log:
  add some comments to the *_rec tests
  
  Revision  ChangesPath
  1.4   +6 -1  modperl-2.0/t/response/TestAPI/conn_rec.pm
  
  Index: conn_rec.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/conn_rec.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- conn_rec.pm   2001/04/19 05:46:04 1.3
  +++ conn_rec.pm   2001/11/13 18:40:01 1.4
  @@ -5,6 +5,11 @@
   
   use Apache::Test;
   
  +use Apache::Const -compile = 'OK';
  +
  +#this test module is only for testing fields in the conn_rec
  +#listed in apache_structures.map
  +
   sub handler {
   my $r = shift;
   
  @@ -48,7 +53,7 @@
   #output_filters
   #remain
   
  -0;
  +Apache::OK;
   }
   
   1;
  
  
  
  1.13  +5 -0  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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- request_rec.pm2001/11/13 18:35:08 1.12
  +++ request_rec.pm2001/11/13 18:40:01 1.13
  @@ -8,6 +8,11 @@
   
   use Apache::Const -compile = 'OK';
   
  +#this test module is only for testing fields in the request_rec
  +#listed in apache_structures.map
  +#XXX: GloabalRequest test should be moved elsewhere
  +# as should $| test
  +
   sub handler {
   my $r = shift;
   
  
  
  
  1.7   +3 -3  modperl-2.0/t/response/TestAPI/server_rec.pm
  
  Index: server_rec.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_rec.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- server_rec.pm 2001/11/13 18:35:08 1.6
  +++ server_rec.pm 2001/11/13 18:40:01 1.7
  @@ -9,6 +9,9 @@
   
   use Apache::Const -compile = 'OK';
   
  +#this test module is only for testing fields in the server_rec
  +#listed in apache_structures.map
  +
   sub handler {
   my $r = shift;
   
  @@ -61,9 +64,6 @@
   ok $s-limit_req_fields;
   
   Apache::OK;
  -
   }
   
   1;
  -
  -__END__
  
  
  



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

2001-11-12 Thread dougm

dougm   01/11/12 14:14:36

  Modified:src/modules/perl modperl_config.c modperl_env.c
   xs/APR/Table APR__Table.h
  Log:
  adjust to const-ness changes
  Submitted by: Philippe M. Chiasson [EMAIL PROTECTED]
  Reviewed by:  dougm
  
  Revision  ChangesPath
  1.47  +1 -1  modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- modperl_config.c  2001/11/05 05:19:01 1.46
  +++ modperl_config.c  2001/11/12 22:14:36 1.47
  @@ -20,7 +20,7 @@
   /* take the 'base' values, and override with 'add' values if any */
   #define merge_table_overlap_item(item) \
   { \
  -apr_array_header_t *arr = apr_table_elts(base-item); \
  +const apr_array_header_t *arr = apr_table_elts(base-item); \
   apr_table_entry_t *entries  = (apr_table_entry_t *)arr-elts; \
   int i; \
   mrg-item = apr_table_copy(p, add-item); \
  
  
  
  1.18  +1 -1  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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- modperl_env.c 2001/10/20 17:38:16 1.17
  +++ modperl_env.c 2001/11/12 22:14:36 1.18
  @@ -84,7 +84,7 @@
   HV *hv = ENVHV;
   U32 mg_flags;
   int i;
  -apr_array_header_t *array;
  +const apr_array_header_t *array;
   apr_table_entry_t *elts;
   
   
  
  
  
  1.7   +1 -1  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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- APR__Table.h  2001/11/07 03:39:08 1.6
  +++ APR__Table.h  2001/11/12 22:14:36 1.7
  @@ -150,7 +150,7 @@
   }
   }
   else {
  -apr_array_header_t *arr = apr_table_elts(t);
  +const apr_array_header_t *arr = apr_table_elts(t);
   apr_table_entry_t *elts  = (apr_table_entry_t *)arr-elts;
   int i;
   
  
  
  



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

2001-11-06 Thread dougm

dougm   01/11/06 09:32:53

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  add mpxs_output_flush for checking $|
  
  Revision  ChangesPath
  1.14  +8 -5  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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Apache__RequestIO.h   2001/09/15 17:57:25 1.13
  +++ Apache__RequestIO.h   2001/11/06 17:32:53 1.14
  @@ -12,6 +12,13 @@
   MARK++; \
   }
   
  +#define mpxs_output_flush(r, rcfg) \
  +/* if ($|) */ \
  +if (IoFLUSH(PL_defoutgv)) { \
  +modperl_wbucket_flush(rcfg-wbucket); \
  +ap_rflush(r); \
  +}
  +
   static MP_INLINE apr_size_t mpxs_ap_rvputs(pTHX_ I32 items,
  SV **MARK, SV **SP)
   {
  @@ -57,11 +64,7 @@
   
   mpxs_write_loop(modperl_wbucket_write, rcfg-wbucket);
   
  -/* if ($|) */
  -if (IoFLUSH(PL_defoutgv)){
  -modperl_wbucket_flush(rcfg-wbucket);
  -ap_rflush(r);
  -}
  +mpxs_output_flush(r, rcfg);
   
   return bytes;
   }  
  
  
  



cvs commit: modperl-2.0/xs modperl_xs_util.h

2001-11-06 Thread dougm

dougm   01/11/06 09:37:25

  Modified:xs   modperl_xs_util.h
  Log:
  s/croak/Perl_croak/g
  
  Revision  ChangesPath
  1.11  +5 -3  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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- modperl_xs_util.h 2001/10/27 17:14:17 1.10
  +++ modperl_xs_util.h 2001/11/06 17:37:25 1.11
  @@ -67,8 +67,9 @@
   }
   
   #define mpxs_usage_va(i, obj, msg) \
  -if ((items  i) || !(mpxs_sv2_obj(obj, *MARK))) \
  -croak(usage: %s, msg); \
  +if ((items  i) || !(mpxs_sv2_obj(obj, *MARK))) { \
  +Perl_croak(aTHX_ usage: %s, msg); \
  +} \
   MARK++
   
   #define mpxs_usage_va_1(obj, msg) mpxs_usage_va(1, obj, msg)
  @@ -77,13 +78,14 @@
   mpxs_usage_va(2, obj, msg); \
   arg = *MARK++
   
  +/* XXX: we probably shouldn't croak here */
   #define mpxs_write_loop(func,obj) \
   while (MARK = SP) { \
   apr_ssize_t wlen; \
   char *buf = SvPV(*MARK, wlen); \
   apr_status_t rv = func(obj, buf, wlen); \
   if (rv != APR_SUCCESS) { \
  -croak(modperl_apr_strerror(rv)); \
  +Perl_croak(aTHX_ modperl_apr_strerror(rv)); \
   } \
   bytes += wlen; \
   MARK++; \
  
  
  



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

2001-11-06 Thread dougm

dougm   01/11/06 09:38:15

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  remove dead mpxs_rwrite_loop macro
  
  Revision  ChangesPath
  1.15  +0 -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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Apache__RequestIO.h   2001/11/06 17:32:53 1.14
  +++ Apache__RequestIO.h   2001/11/06 17:38:15 1.15
  @@ -3,15 +3,6 @@
   
   #define mpxs_Apache__RequestRec_PRINT mpxs_Apache__RequestRec_print
   
  -#define mpxs_rwrite_loop(func,obj) \
  -while (MARK = SP) { \
  -STRLEN len; \
  -char *buf = SvPV(*MARK, len); \
  -int wlen = func(obj, buf, len); \
  -bytes += wlen; \
  -MARK++; \
  -}
  -
   #define mpxs_output_flush(r, rcfg) \
   /* if ($|) */ \
   if (IoFLUSH(PL_defoutgv)) { \
  
  
  



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

2001-11-06 Thread dougm

dougm   01/11/06 09:40:22

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  fix $| comment for $r-puts
  
  Revision  ChangesPath
  1.16  +3 -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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Apache__RequestIO.h   2001/11/06 17:38:15 1.15
  +++ Apache__RequestIO.h   2001/11/06 17:40:22 1.16
  @@ -31,7 +31,9 @@
   MP_END_TIMES();
   MP_PRINT_TIMES(r-puts);
   
  -/* XXX: flush if $| */
  +/* we do not check $| for this method,
  + * only in the functions called by the tied interface
  + */
   
   return bytes;
   }
  
  
  



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

2001-11-06 Thread dougm

dougm   01/11/06 09:50:56

  Modified:xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  remove unused scfg variable
  
  Revision  ChangesPath
  1.17  +0 -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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Apache__RequestIO.h   2001/11/06 17:40:22 1.16
  +++ Apache__RequestIO.h   2001/11/06 17:50:56 1.17
  @@ -13,7 +13,6 @@
   static MP_INLINE apr_size_t mpxs_ap_rvputs(pTHX_ I32 items,
  SV **MARK, SV **SP)
   {
  -modperl_config_srv_t *scfg;
   modperl_config_req_t *rcfg;
   apr_size_t bytes = 0;
   request_rec *r;
  @@ -22,7 +21,6 @@
   mpxs_usage_va_1(r, $r-puts(...));
   
   rcfg = modperl_config_req_get(r);
  -scfg = modperl_config_srv_get(r-server);
   
   MP_START_TIMES();
   
  @@ -42,7 +40,6 @@
   apr_size_t mpxs_Apache__RequestRec_print(pTHX_ I32 items,
SV **MARK, SV **SP)
   {
  -modperl_config_srv_t *scfg;
   modperl_config_req_t *rcfg;
   request_rec *r;
   
  @@ -53,7 +50,6 @@
   mpxs_usage_va_1(r, $r-print(...));
   
   rcfg = modperl_config_req_get(r);
  -scfg = modperl_config_srv_get(r-server);
   
   mpxs_write_loop(modperl_wbucket_write, rcfg-wbucket);
   
  
  
  



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/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 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/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;
  
  
  



<    1   2   3   4   5   6   7   8   >