httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: httpd-apreq/Request Request.xs
Date Sun, 12 Aug 2001 15:59:16 GMT
joes        01/08/12 08:59:16

  Modified:    .        typemap
               Request  Request.xs
  Log:
  Bugfix: refcount too high for ${$upload->fh}, (culprit is T_IN stub code
          from ExtUtils/typemap). Leak caused deleted files to remain open
          for lifetime of process.
  
          Spotted by Jeffrey Hartmann <lefty@lefty.org>.
  
  Revision  Changes    Path
  1.2       +12 -0     httpd-apreq/typemap
  
  Index: typemap
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/typemap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- typemap	1999/01/27 01:33:20	1.1
  +++ typemap	2001/08/12 15:59:16	1.2
  @@ -3,8 +3,20 @@
   Apache::Upload		T_PTROBJ
   Apache			T_APACHEOBJ
   const char *		T_PV
  +ApreqInputStream        T_APREQIN
   
   OUTPUT
  +
  +T_APREQIN
  +        {
  +            GV *gv = newGVgen("$Package");
  +            if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) )
  +                sv_setsv($arg, sv_bless(newRV_noinc((SV*)gv), 
  +                                        gv_stashpv("$Package",1)));
  +            else
  +                $arg = &PL_sv_undef;
  +            (void)hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
  +        }
   
   T_APACHEOBJ
   	sv_setref_pv($arg, \"${ntype}\", (void*)$var);
  
  
  
  1.26      +4 -14     httpd-apreq/Request/Request.xs
  
  Index: Request.xs
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Request.xs	2001/06/29 19:13:17	1.25
  +++ Request.xs	2001/08/12 15:59:16	1.26
  @@ -109,7 +109,7 @@
   #define ApacheUpload_tempname(upload) upload->tempname
   
   #ifdef PerlIO
  -typedef PerlIO * InputStream;
  +typedef PerlIO * ApreqInputStream;
   
   /* XXX: or should this be #ifdef PERL_IMPLICIT_SYS ? */
   #ifdef WIN32
  @@ -125,7 +125,7 @@
   
   #else /*PerlIO not defined*/
   
  -typedef FILE * InputStream;
  +typedef FILE * ApreqInputStream;
   #define PerlIO_importFILE(fp,flags) 	fp
   #define PerlIO_write(a,b,c)  		fwrite((b),1,(c),(a))
   
  @@ -256,14 +256,6 @@
       SvMAGIC(SvRV(sv))->mg_ptr = (char *)req->r;
   }
   
  -static void apreq_close_handle(void *data)
  -{
  -    GV *handle = (GV*)data;
  -    (void)hv_delete(GvSTASH(handle),
  -		    GvNAME(handle), GvNAMELEN(handle), G_DISCARD);
  -}
  -
  -
   #ifdef CGI_COMPAT
   static void register_uploads (ApacheRequest *req) {
       ApacheUpload *upload;
  @@ -505,7 +497,7 @@
   
   PROTOTYPES: DISABLE 
   
  -InputStream
  +ApreqInputStream
   ApacheUpload_fh(upload)
       Apache::Upload upload
   
  @@ -530,9 +522,7 @@
   	if (upload->req->parsed)
   	    PerlIO_seek(fp, 0, 0);
   
  -	IoIFP(GvIOn((GV*)SvRV(ST(0)))) = fp;  	
  -	ap_register_cleanup(upload->req->r->pool, (void*)SvRV(ST(0)), 
  -			    apreq_close_handle, ap_null_cleanup);      
  +	IoIFP(io) = fp;  	
       }
   
   long
  
  
  

Mime
View raw message