[tpop3d-discuss] Re: Too many open files

Chris Lightfoot chris at ex-parrot.com
Fri, 22 Mar 2002 19:34:01 +0000


On Thu, Mar 21, 2002 at 10:39:16PM +0000, John P Connor wrote:
> 
> >
> >> I can't reproduce this here. The running tpop3d doesn't
> >> create additional file descriptors, as checked by looking
> >> at /proc/$pid/fd on Linux. I don't know what tool you can
> >> use to test this on Solaris.
> 
> I think this was my problem .. I missed an "untie" off in my auth script. 
> Trying to be clever & only tying once, you see, & untying at different 
> points. Oops.
    [...]
>  & running about 15-20 of them in the background, started at random 
> intervals. Slowly, tpop3d starts to grow in size. The account has only a 
> single mail in it.

Please try the following patch; it seems to work for me,
but I'm not 100% certain that it's correct:

diff -u -r1.21 auth_perl.c
--- auth_perl.c 2002/03/18 23:47:33     1.21
+++ auth_perl.c 2002/03/22 19:33:12
@@ -217,8 +217,11 @@
             STRLEN len2;
             stringmap_insert(s, key, item_ptr(xstrdup(SvPV(val, len2))));
         }
+        SvREFCNT_dec(hashref_out);
     }
 
+    SvREFCNT_dec(hashref_in);
+    
     FREETMPS;
     LEAVE;
 


-- 
 Today is the tomorrow you worried about yesterday