INN commit: trunk/innfeed (host.c)
INN Commit
Russ_Allbery at isc.org
Sun Jan 18 14:01:50 UTC 2009
Date: Sunday, January 18, 2009 @ 06:01:50
Author: iulius
Revision: 8293
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:
trunk/innfeed/host.c
--------+
host.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Modified: host.c
===================================================================
--- host.c 2009-01-18 09:41:58 UTC (rev 8292)
+++ host.c 2009-01-18 14:01:50 UTC (rev 8293)
@@ -1717,7 +1717,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)) {
@@ -1752,7 +1752,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 ;
@@ -1763,7 +1763,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