]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 07:06:00 +0000 (20:06 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 07:06:00 +0000 (20:06 +1300)
Bug 2505: assertion failed: comm.cc:350: "!fd_table[fd].closing()" (comment #12,bug 2505)

This patch fixes the bug reported in comment #12 of bug 2505.
In the DeferredReadManager::kickARead method it is possible that the socket in
which refers a DeferredRead object has been closed, but the DeferredReadManager
is not informed yet because the related comm_close handler has not been
executed yet.
This patch checks the socket state and if it is closing just ignore the object.

src/comm.cc

index 1c965de003c7a2b7da1e22a06ba0200da70e5b59..23147723a92f45f7c7e077533e95b410c17585db 100644 (file)
@@ -2564,6 +2564,9 @@ DeferredReadManager::kickARead(DeferredRead const &aRead) {
     if (aRead.cancelled)
         return;
 
+    if(aRead.theRead.fd>=0 && fd_table[aRead.theRead.fd].closing())
+       return;
+
     debugs(5, 3, "Kicking deferred read on FD " << aRead.theRead.fd);
 
     aRead.theReader(aRead.theContext, aRead.theRead);