cvs commit: modperl-2.0/lib mod_perl.pm

2002-08-20 Thread dougm

dougm   2002/08/20 09:49:12

  Modified:.Changes
   lib  mod_perl.pm
  Log:
  bump version
  
  Revision  ChangesPath
  1.37  +2 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Changes   20 Aug 2002 16:45:00 -  1.36
  +++ Changes   20 Aug 2002 16:49:11 -  1.37
   -8,6 +8,8 
   
   =over 3
   
  +=item 1.99_06-dev
  +
   =item 1.99_05 - August 20, 2002
   
   fix PerlOptions +ParseHeaders to only parse once per-request
  
  
  
  1.6   +1 -1  modperl-2.0/lib/mod_perl.pm
  
  Index: mod_perl.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/mod_perl.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_perl.pm   21 Jun 2002 22:35:49 -  1.5
  +++ mod_perl.pm   20 Aug 2002 16:49:12 -  1.6
   -4,7 +4,7 
   use strict;
   
   BEGIN {
  -our $VERSION = 1.9905;
  +our $VERSION = 1.9906;
   }
   
   1;
  
  
  



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

2002-08-20 Thread stas

stas2002/08/20 21:44:14

  Modified:xs/APR/PerlIO apr_perlio.c
  Log:
  improve errors handling
  add extended debugging trace
  
  Revision  ChangesPath
  1.21  +34 -11modperl-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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- apr_perlio.c  5 Jul 2002 05:05:36 -   1.20
  +++ apr_perlio.c  21 Aug 2002 04:44:14 -  1.21
   -268,13 +268,20 
   
   #ifdef PERLIO_APR_DEBUG
   const char *new_path = NULL;
  +apr_os_file_t os_file;
  +
   if (!PL_dirty) {
   /* if this is called during perl_destruct we are in trouble */
   apr_file_name_get(new_path, st-file);
   }
   
  -Perl_warn(aTHX_ PerlIOAPR_close obj=0x%lx, file=0x%lx, name=%s\n,
  -  (unsigned long)f, (unsigned long)st-file,
  +rc = apr_os_file_get(os_file, st-file); 
  +if (rc != APR_SUCCESS) {
  +Perl_croak(aTHX_ filedes retrieval failed!);
  +}
  +
  +Perl_warn(aTHX_ PerlIOAPR_close obj=0x%lx, file=0x%lx, fd=%d, name=%s\n,
  +  (unsigned long)f, (unsigned long)st-file, os_file,
 new_path ? new_path : (UNKNOWN));
   #endif
   
   -415,9 +422,11 
   {
   char *mode;
   const char *layers = :APR;
  +PerlIOAPR *st;
   PerlIO *f = PerlIO_allocate(aTHX);
  +
   if (!f) {
  -return NULL;
  +Perl_croak(aTHX_ Failed to allocate PerlIO struct);
   }
   
   switch (type) {
   -430,19 +439,33 
   };
   
   PerlIO_apply_layers(aTHX_ f, mode, layers);
  +if (!f) {
  +Perl_croak(aTHX_ Failed to apply the ':APR' layer);
  +}
   
  -if (f) {
  -PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR);
  +st = PerlIOSelf(f, PerlIOAPR);
   
  -/* XXX: should we dup first? the timeout could close the fh! */
  -st-pool = pool;
  -st-file = file;
  -PerlIOBase(f)-flags |= PERLIO_F_OPEN;
  +#ifdef PERLIO_APR_DEBUG
  +{
  +apr_status_t rc;
  +apr_os_file_t os_file;
   
  -return f;
  +/* convert to the OS representation of file */
  +rc = apr_os_file_get(os_file, file); 
  +if (rc != APR_SUCCESS) {
  +croak(filedes retrieval failed!);
  +}
  +
  +Perl_warn(aTHX_ converting to PerlIO fd %d, mode '%s'\n,
  +  os_file, mode);
   }
  +#endif
  +
  +st-pool = pool;
  +st-file = file;
  +PerlIOBase(f)-flags |= PERLIO_F_OPEN;
   
  -return NULL;
  +return f;
   }
   
   static SV *apr_perlio_PerlIO_to_glob(pTHX_ PerlIO *pio, apr_perlio_hook_e type)
  
  
  



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

2002-08-20 Thread stas

stas2002/08/20 21:46:44

  Modified:xs/APR/PerlIO apr_perlio.c
  Log:
  - IoIFP(io) *must* be always set on the valid io sv, otherwise it'll be
  never closed and fh and memory leaked. as i saw from doio.c, the solution
  is to simply copy IoOFP.
  - add IoTYPE_WRONLY and IoTYPE_RDONLY flags to protect from wrong use
  
  Revision  ChangesPath
  1.22  +5 -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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- apr_perlio.c  21 Aug 2002 04:44:14 -  1.21
  +++ apr_perlio.c  21 Aug 2002 04:46:44 -  1.22
   -478,11 +478,15 
   
   switch (type) {
 case APR_PERLIO_HOOK_WRITE:
  -IoOFP(GvIOp(gv)) = pio;
  +  /* if IoIFP() is not assigned to it'll be never closed, see
  +   * Perl_io_close() */
  +IoIFP(GvIOp(gv)) = IoOFP(GvIOp(gv)) = pio;
   IoFLAGS(GvIOp(gv)) |= IOf_FLUSH;
  +IoTYPE(GvIOp(gv)) = IoTYPE_WRONLY;
   break;
 case APR_PERLIO_HOOK_READ:
   IoIFP(GvIOp(gv)) = pio;
  +IoTYPE(GvIOp(gv)) = IoTYPE_RDONLY;
   break;
   };