internal SITEreader

Marco d'Itri md at Linux.IT
Sun Feb 2 00:14:08 UTC 2003


On Feb 01, Russ Allbery <rra at stanford.edu> wrote:

 >Yes, that's exactly the approach I was going to work on this weekend.  If
 >you end up with a patch, that will save me from work.  :)
You can start from this. It has been triggered once in ~6 hours and it
appears to work without any side effect.

diff -u innd.orig/chan.c innd/chan.c
--- innd.orig/chan.c	2003-01-19 21:58:02.000000000 +0100
+++ innd/chan.c	2003-02-01 17:28:58.000000000 +0100
@@ -38,7 +38,7 @@
    readloop */
 #define COMP_THRESHOLD 10
 
-static fd_set	RCHANmask;
+fd_set	RCHANmask;
 static fd_set	SCHANmask;
 static fd_set	WCHANmask;
 static int	SCHANcount;
diff -u innd.orig/site.c innd/site.c
--- innd.orig/site.c	2003-02-01 18:35:51.000000000 +0100
+++ innd/site.c	2003-02-01 21:35:57.000000000 +0100
@@ -11,6 +11,7 @@
 #include "innd.h"
 
 
+static int	SITEreadererr = 1;
 static int	SITEcount;
 static int	SITEhead = NOSITE;
 static int	SITEtail = NOSITE;
@@ -23,7 +24,21 @@
 static void
 SITEreader(CHANNEL *cp)
 {
+    extern fd_set  RCHANmask;
+    if (SITEreadererr == 0)
+	return;
     syslog(L_ERROR, "%s internal SITEreader: %s", LogName, CHANname(cp));
+    if (FD_ISSET(cp->fd, &RCHANmask)) {
+	syslog(L_ERROR, "%s SITEreader: BUG, trying to fix chan=%s fd=%d",
+		LogName, CHANname(cp), cp->fd);
+	RCHANremove(cp);
+    } else
+	syslog(L_ERROR, "%s SITEreader: ???", LogName);
+    if (SITEreadererr == 10) {
+	SITEreadererr = 0;
+	syslog(L_ERROR, "%s SITEreader logging disabled", LogName);
+    }
+    SITEreadererr++;
 }
 
 

-- 
ciao,
Marco


More information about the inn-workers mailing list