The mod_perl implementation of get_client_block has a memory leak.
The following patch should keep it from from pissing in r->pool.

diff -u /var/lib/cpan/build/mod_perl-1.24/src/modules/perl/Apache.xs 
/usr/src/mod_perl-1.24/src/modules/perl/Apache.xs 

--- /var/lib/cpan/build/mod_perl-1.24/src/modules/perl/Apache.xs        Fri Apr 
21 02:13:42 2000
+++ /usr/src/mod_perl-1.24/src/modules/perl/Apache.xs   Sat Jul 15 18:27:58 2000
@@ -59,7 +59,7 @@
 #define CORE_PRIVATE
 #include "mod_perl.h"
 #include "mod_perl_xs.h"
-
+#define BUFSIZE 8192
 
 #ifdef USE_SFIO
 #undef send_fd_length    
@@ -994,10 +994,11 @@
 
     PREINIT:
     long nrd = 0;
+    char buf[BUFSIZE];
 
     PPCODE:
-    buffer = (char*)palloc(r->pool, bufsiz);
-    nrd = get_client_block(r, buffer, bufsiz);
+    buffer = buf;
+    nrd = get_client_block(r, buffer, (bufsiz < BUFSIZE) ? bufsiz : BUFSIZE);
     if ( nrd > 0 ) {
        XPUSHs(sv_2mortal(newSViv((long)nrd)));
        sv_setpvn((SV*)ST(1), buffer, nrd);


 
Joe Schaefer
[EMAIL PROTECTED]

SunStar Systems, Inc.


Reply via email to