INN commit: branches/2.4/innfeed (host.c)

INN Commit Russ_Allbery at isc.org
Sun Jan 18 14:03:55 UTC 2009


    Date: Sunday, January 18, 2009 @ 06:03:54
  Author: iulius
Revision: 8294

Fix an assertion failure in innfeed.
connections is a NULL-terminated array; cxn can then be NULL
if maxConnections connections are not open.

Thanks to William Kronert for the bug report.

Modified:
  branches/2.4/innfeed/host.c

--------+
 host.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Modified: host.c
===================================================================
--- host.c	2009-01-18 14:01:50 UTC (rev 8293)
+++ host.c	2009-01-18 14:03:54 UTC (rev 8294)
@@ -1793,7 +1793,7 @@
         unsigned int x_queue = host->params->maxChecks + 1 ;
 
         for (idx = 0 ; x_queue > 0 && idx < host->maxConnections ; idx++)
-          if ((cxn = host->connections[idx]) != host->notThisCxn) {
+          if ((cxn = host->connections[idx]) != host->notThisCxn && cxn != NULL) {
             if (!host->cxnActive [idx]) {
               if (!host->cxnSleeping [idx]) {
                 if (cxnTakeArticle (cxn, extraRef)) {
@@ -1828,7 +1828,7 @@
           {
             if (host->cxnActive [idx] &&
                 (cxn = host->connections[idx]) != host->notThisCxn &&
-                cxnTakeArticle (cxn, extraRef)) {
+                cxn != NULL && cxnTakeArticle (cxn, extraRef)) {
               unsigned int queue = host->params->maxChecks - cxnQueueSpace (cxn) - 1;
               if (queue == 0) host->gNoQueue++ ;
               else            host->gCxnQueue += queue ;
@@ -1839,7 +1839,7 @@
         /* Wasn't taken so try to give it to one of the waiting connections. */
         for (idx = 0 ; idx < host->maxConnections ; idx++)
           if (!host->cxnActive [idx] && !host->cxnSleeping [idx] &&
-              (cxn = host->connections[idx]) != host->notThisCxn)
+              (cxn = host->connections[idx]) != host->notThisCxn && cxn != NULL)
             {
               if (cxnTakeArticle (cxn, extraRef)) {
                 unsigned int queue = host->params->maxChecks - cxnQueueSpace (cxn) - 1;




More information about the inn-committers mailing list