]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Nov 2011 10:44:38 +0000 (03:44 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Nov 2011 10:44:38 +0000 (03:44 -0700)
Check Deferred read FD is still active before re-scheduling the read.

src/comm.cc

index 7fb20fed7a9ea6d9326121d6da48985c2f7d0178..4a45eb04005880251ff26d69220f9a21d9c726fe 100644 (file)
@@ -2047,6 +2047,19 @@ DeferredReadManager::popHead(CbDataListContainer<DeferredRead> &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;