On Fri, May 03, 2002 at 04:17:43PM -0400, Ross Vandegrift wrote:
> On a related note, is spamass-milter at all reliable for you?  I have
> huge amounts of problems with it spinning off a ridiculous number of
> sub-processess (spamass-milter and spamc) that never return.  I'm
> considering figuring out why this seems so broken, if I can verify it's
> not just my setup.

I had a problem with it where it would deadlock with the spamc process if
the message was over 250k (or whatever the max size for spamc/spamd).  I
ended up solving it by adding a read() loop to spamc to flush the read
buffer so that the milter would be ready for the response.  It's probably
not the best solution, but I'll attach the patch anyway.

Dan.
--- spamc.c.orig        Fri May  3 13:37:04 2002
+++ spamc.c     Mon Apr 29 16:31:25 2002
@@ -94,6 +94,7 @@
 {
   int total;
   int thistime;
+  char *dump;
 
   for (total = 0; total < min; ) {
     thistime = read (fd, buf+total, len-total);
@@ -108,6 +109,17 @@
 
     total += thistime;
   }
+
+  if (((len-total-thistime) <= 0) && (min > 8192)) { /* Flush read buffer if this was 
+a big read */
+     dump = malloc (102400); /* 100k */               /* Kind of a kludge, I know... 
+*/
+
+     if (dump) {
+        while (read (fd, dump, 102400));
+
+        free (dump);
+     }
+   }
+
   return total;
 }
 

Reply via email to