Arrgh! latest innfeed crashes like heck!

Sven Paulus sven at karlsruhe.org
Thu Apr 13 23:52:04 UTC 2000


In article <Pine.BSF.3.96.1000413193312.11835I-100000 at fLuFFy.iNt.tElE.dK> you wrote:
|> So there's something confused about the responses this peer is giving
|> me, but there's also a problem with innfeed not being able to handle
|> the `435' case above.  Which is weird, since we had been feeding this
|> peer from an old 0.10.1.7+hacks CNFS-ized and bug-fixated innfeed for
|> years.

Another problem concerning innfeed came up on de.admin.news.misc some days
ago: Someone posted an article containing a Message-ID 494 characters long.
Now some NNTPRelay and Diablo peers rejected this Message-ID as being too
long with an 500 return code (= syntax error). innfeed logged a cxnsleep
message and requeued the article for resending it later. You surely will
guess what follows? innfeed is happily trying to resend this article over
and over again, until you force a shutdown of the innfeed process and dig
the Message-ID out of the batch files ...

The real problem is, that innfeed has only _one_ return code handler for all
commands, so you have to figure out, whether the 500 was in reply to an
IHAVE, to a CHECK or to a TAKETHIS command.

My idea how a handler function for 500 replies could look like is this, but
I haven't tested it yet (I'd have to setup a isolated test environment, I
don't want to pollute the 'real' net with articles causing problems).
But maybe who knows innfeed a little better than me could have a look on it
and say if this makes sense:

--- connection.c.orig	Thu Apr 13 05:06:26 2000
+++ connection.c	Thu Apr 13 05:15:54 2000
@@ -310,6 +310,7 @@
 static void processResponse436 (Connection cxn, char *response) ;
 static void processResponse437 (Connection cxn, char *response) ;
 static void processResponse480 (Connection cxn, char *response) ;
+static void processResponse500 (Connection cxn, char *response) ;
 
 
 /* Misc functions */
@@ -1792,7 +1793,10 @@
           case 480:             /* Transfer permission denied. */
             processResponse480  (cxn,response) ;
             break ;
-            
+
+          case 500:             /* command not recognized */
+            processResponse500 (cxn, response) ;
+            break;
 
           default:
             syslog (LOG_ERR, UNKNOWN_RESPONSE, peerName, cxn->ident,
@@ -3107,6 +3111,88 @@
 }
 
 
+static void processResponse500 (Connection cxn, char *response)
+{
+  ArtHolder artHolder ;
+
+  if (!cxn->doesStreaming)
+    {
+        /* we got a 500 answer in response to IHAVE */
+        if (!(cxn->state == cxnFlushingS ||
+              cxn->state == cxnFeedingS ||
+              cxn->state == cxnClosingS))
+          {
+            syslog (LOG_ERR,CXN_BAD_STATE,hostPeerName (cxn->myHost),
+                    cxn->ident,stateToString (cxn->state)) ;
+            cxnSleepOrDie (cxn) ;
+            return ;
+          }
+
+        ASSERT (cxn->articleQTotal == 1) ;
+        ASSERT (cxn->checkRespHead != NULL) ;
+        VALIDATE_CONNECTION (cxn) ;
+
+        cxn->articleQTotal-- ;
+        cxn->checksRefused++ ;
+
+        artHolder = cxn->checkRespHead ;
+        cxn->checkRespHead = NULL ;
+
+        if (cxn->articleQTotal == 0)
+          cxnIdle (cxn) ;
+
+        hostArticleNotWanted (cxn->myHost, cxn, artHolder->article) ;
+        delArtHolder (artHolder) ;
+        return;
+    }
+
+  /* We are streaming, so the 500 is either a reply to
+     CHECK or TAKETHIS */  
+  if (!(cxn->state == cxnFlushingS ||
+        cxn->state == cxnFeedingS ||
+        cxn->state == cxnClosingS))
+    {
+      syslog (LOG_ERR,CXN_BAD_STATE,hostPeerName (cxn->myHost),
+              cxn->ident,stateToString (cxn->state)) ;
+      cxnSleepOrDie (cxn) ;
+      return ;
+    }
+  
+  VALIDATE_CONNECTION (cxn) ;
+
+  /* CHECK */
+  if (cxn->checkRespHead != NULL)
+    {
+      cxn->checksRefused++ ;
+      artHolder = cxn->checkRespHead ;
+      remArtHolder (artHolder, &cxn->checkRespHead, &cxn->articleQTotal) ;
+      if (cxn->articleQTotal == 0)
+        cxnIdle (cxn) ;
+      hostArticleNotWanted (cxn->myHost, cxn, artHolder->article);
+      delArtHolder (artHolder) ;
+    }
+  /* TAKETHIS */
+  else if (cxn->takeRespHead != NULL)
+    {
+      cxn->takesRejected++ ;
+      artHolder = cxn->takeRespHead ;
+      remArtHolder (artHolder, &cxn->takeRespHead, &cxn->articleQTotal) ;
+      /* Some(?) hosts return the 500 response even before we're done
+          sending */ 
+      if (cxn->articleQTotal == 0 && !writeIsPending(cxn->myEp))
+        cxnIdle (cxn) ;
+      hostArticleRejected (cxn->myHost, cxn, artHolder->article) ;
+      delArtHolder (artHolder) ;
+    }
+  else
+    {
+      syslog (LOG_NOTICE,BAD_RESPONSE,
+              hostPeerName (cxn->myHost),cxn->ident,438) ;
+      cxnSleepOrDie (cxn) ;
+      return ;
+    }
+
+}
 
 
 



Sven




More information about the inn-workers mailing list