]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Save come CPU cycles scheduling useless calls
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 4 Dec 2010 03:29:14 +0000 (16:29 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 4 Dec 2010 03:29:14 +0000 (16:29 +1300)
src/comm/ConnOpener.cc
src/pconn.cc

index ef1d0c3aa5a2c14b0a292cdb8e453a042f6d7783..36fdf70ba2efbcef703f2cdaa6112d7dc729687c 100644 (file)
@@ -198,6 +198,10 @@ Comm::ConnOpener::connect()
 {
     Must(conn_ != NULL);
 
+    // our parent Jobs signal abort by cancelling their callbacks.
+    if (callback_ == NULL || callback_->canceled())
+        return;
+
     totalTries_++;
 
     switch (comm_connect_addr(conn_->fd, conn_->remote) ) {
index 4933495b5a99cb4fe1224392749304c24c5c1f65..19716bb7e5b7f39654ad7fae0ceb4b7bdba4f0f0 100644 (file)
@@ -207,6 +207,7 @@ IdleConnList::Read(const Comm::ConnectionPointer &conn, char *buf, size_t len, c
     if (index >= 0) {
         /* might delete list */
         list->removeAt(index);
+        list->clearHandlers(conn);
     }
     // else we lost a race.
     // Somebody started using the pconn since the remote end disconnected.