503 handling for innfeed
Kenichi Okada
okada at opaopa.org
Tue Aug 27 08:47:59 UTC 2002
Hi,
nnrpd returns response 503 if connection is timeout.
We use innfeed to feed to nnrpd, so innfeed is confused by the response 503.
Aug 23 03:14:48 news innfeed[72675]: news.media.kyoto-u.ac.jp:0 cxnsleep response unknown : 503 : 503 Timeout after 600 seconds, closing connection.
Aug 23 03:30:20 news innfeed[72675]: news.media.kyoto-u.ac.jp:0 cxnsleep non-responsive connection
This patch is for a process of response 503.
--
Kenichi Okada
mailto:okada at opaopa.org
--- inn-CURRENT-20020827/innfeed/connection.c-OLD 2002-08-27 17:28:38.000000000 +0900
+++ inn-CURRENT-20020827/innfeed/connection.c 2002-08-27 17:30:56.000000000 +0900
@@ -305,6 +305,7 @@
static void processResponse436 (Connection cxn, char *response) ;
static void processResponse437 (Connection cxn, char *response) ;
static void processResponse480 (Connection cxn, char *response) ;
+static void processResponse503 (Connection cxn, char *response) ;
/* Misc functions */
@@ -2149,6 +2150,9 @@
processResponse480 (cxn,response) ;
break ;
+ case 503: /* remote timeout. */
+ processResponse503 (cxn,response) ;
+ break ;
default:
syslog (LOG_ERR, UNKNOWN_RESPONSE, peerName, cxn->ident,
@@ -3566,6 +3570,56 @@
+/*
+ * Handle the response 503, which means the timeout of nnrpd.
+ */
+static void processResponse503 (Connection cxn, char *response)
+{
+ bool immedRecon ;
+
+ VALIDATE_CONNECTION (cxn) ;
+
+ (void) response ; /* keep lint happy */
+
+ if (!(cxn->state == cxnFeedingS ||
+ cxn->state == cxnIdleS ||
+ cxn->state == cxnFlushingS ||
+ cxn->state == cxnClosingS))
+ {
+ syslog (LOG_ERR,CXN_BAD_STATE,hostPeerName (cxn->myHost),
+ cxn->ident,stateToString (cxn->state)) ;
+ cxnSleepOrDie (cxn) ;
+ return ;
+ }
+
+ if (cxn->articleQTotal != 0) {
+ syslog (LOG_NOTICE,CXN_REOPEN_FAILED,hostPeerName (cxn->myHost),cxn->ident) ;
+ }
+
+ cxnLogStats (cxn,true) ;
+
+ immedRecon = cxn->immedRecon ;
+
+ hostCxnDead (cxn->myHost,cxn) ;
+
+ if (cxn->state == cxnFlushingS && immedRecon)
+ {
+ abortConnection (cxn) ;
+ if (!cxnConnect (cxn))
+ syslog (LOG_NOTICE,CXN_REOPEN_FAILED,hostPeerName (cxn->myHost),
+ cxn->ident) ;
+ }
+ else if (cxn->state == cxnFlushingS)
+ cxnWait (cxn) ;
+ else
+ cxnDead (cxn) ;
+
+}
+
+
+
+
+
/****************************************************************************
*
* END REPONSE CODE PROCESSING.
More information about the inn-workers
mailing list