From: Amos Jeffries Date: Thu, 24 Nov 2011 10:44:38 +0000 (-0700) Subject: Bug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads X-Git-Tag: BumpSslServerFirst.take05~12^2~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7e8ebdb2d09e16eba4631625a76f67bed737262;p=thirdparty%2Fsquid.git Bug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads Check Deferred read FD is still active before re-scheduling the read. --- diff --git a/src/comm.cc b/src/comm.cc index 7fb20fed7a..4a45eb0400 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -2047,6 +2047,19 @@ DeferredReadManager::popHead(CbDataListContainer &deferredReads) assert (!deferredReads.empty()); DeferredRead &read = deferredReads.head->element; + + // NOTE: at this point the connection has been paused/stalled for an unknown + // amount of time. We must re-validate that it is active and usable. + + // If the connection has been closed already. Cancel this read. + if (!Comm::IsConnOpen(read.theRead.conn)) { + if (read.closer != NULL) { + read.closer->cancel("Connection closed before."); + read.closer = NULL; + } + read.markCancelled(); + } + if (!read.cancelled) { comm_remove_close_handler(read.theRead.conn->fd, read.closer); read.closer = NULL;