]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Squid Assertion Read.cc:205: "params.data == data"
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 5 May 2015 17:40:36 +0000 (20:40 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 5 May 2015 17:40:36 +0000 (20:40 +0300)
Inside IdleConnList::findUseable the IdleConnList::removeAt call can delete
"this" IdleConnList object. The IdleConnList::clearHandlers called imediatelly
after the removeAt method, will try to use the invalid "this" object in
a comm_read_cancel function call, causing this assertion or other similar.

This patch fixes the IdleConnList::findUseable, IdleConnList::pop and
IdleConnList::findAndClose methods to call IdleConnList::clearHandlers before
the IdleConnList::removeAt is called.

This is a Measurement Factory project

src/pconn.cc

index 0964f8044e9f113beaf44d19db214bf7f65b916d..248b1ca898d56fa5bbdc30a5d6b66ca2372a3e51 100644 (file)
@@ -218,9 +218,9 @@ IdleConnList::pop()
 
         // finally, a match. pop and return it.
         Comm::ConnectionPointer result = theList_[i];
+        clearHandlers(result);
         /* may delete this */
         removeAt(i);
-        clearHandlers(result);
         return result;
     }
 
@@ -264,9 +264,9 @@ IdleConnList::findUseable(const Comm::ConnectionPointer &key)
 
         // finally, a match. pop and return it.
         Comm::ConnectionPointer result = theList_[i];
+        clearHandlers(result);
         /* may delete this */
         removeAt(i);
-        clearHandlers(result);
         return result;
     }
 
@@ -281,9 +281,9 @@ IdleConnList::findAndClose(const Comm::ConnectionPointer &conn)
     if (index >= 0) {
         if (parent_)
             parent_->notifyManager("idle conn closure");
+        clearHandlers(conn);
         /* might delete this */
         removeAt(index);
-        clearHandlers(conn);
         conn->close();
     }
 }