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, 03 Nov 2002 20:58:10 GMT
joes        2002/11/03 12:58:10

  Modified:    Request  Request.xs
  Log:
  Doug's 5.8.0 PerlIO* leak fix- see http://mathforum.org/epigone/modperl/glongsnaysimp
  
  Revision  Changes    Path
  1.29      +7 -12     httpd-apreq/Request/Request.xs
  
  Index: Request.xs
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Request.xs	20 Jan 2002 17:27:35 -0000	1.28
  +++ Request.xs	3 Nov 2002 20:58:09 -0000	1.29
  @@ -491,8 +491,13 @@
   ApacheUpload_fh(upload)
       Apache::Upload upload
   
  +    PREINIT:
  +    int fd;
  +
       CODE:
  -    if (  ( RETVAL = PerlIO_importFILE(ApacheUpload_fh(upload),0) ) == NULL  )
  +    fd = PerlLIO_dup(fileno(ApacheUpload_fh(upload)));
  +
  +    if ( !(RETVAL = PerlIO_fdopen(fd, "r")) )
   	    XSRETURN_UNDEF;
   
       OUTPUT:
  @@ -501,18 +506,8 @@
       CLEANUP:
       if (ST(0) != &PL_sv_undef) {
   	IO *io = GvIOn((GV*)SvRV(ST(0)));
  -	int fd = PerlIO_fileno(IoIFP(io));
  -	PerlIO *fp;
  -
  -	fd = PerlLIO_dup(fd);
  -	if (!(fp = PerlIO_fdopen(fd, "r"))) { 
  -	    PerlLIO_close(fd);
  -	    croak("fdopen failed!");
  -	}
   	if (upload->req->parsed)
  -	    PerlIO_seek(fp, 0, 0);
  -
  -	IoIFP(io) = fp;  	
  +	    PerlIO_seek(IoIFP(io), 0, 0);
       }
   
   long
  
  
  

Mime
View raw message