From: Christos Tsantilas Date: Fri, 4 Nov 2016 16:48:53 +0000 (+0200) Subject: FwdState::connectStart() cleanup X-Git-Tag: SQUID_4_0_17~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60199bd763f7c837e813a70151e0890cad95743c;p=thirdparty%2Fsquid.git FwdState::connectStart() cleanup The pinned_connection->stopPinnedConnectionMonitoring() call does not needed, it is already called from inside pinned_connection->borrowPinnedConnection called two lines before. This is a Measurement Factory project --- diff --git a/src/FwdState.cc b/src/FwdState.cc index c78019202a..da6927b598 100644 --- a/src/FwdState.cc +++ b/src/FwdState.cc @@ -847,28 +847,25 @@ FwdState::connectStart() ConnStateData *pinned_connection = request->pinnedConnection(); debugs(17,7, "pinned peer connection: " << pinned_connection); // pinned_connection may become nil after a pconn race - if (pinned_connection) { - serverConn = pinned_connection->borrowPinnedConnection(request, serverDestinations[0]->getPeer()); - if (Comm::IsConnOpen(serverConn)) { - pinned_connection->stopPinnedConnectionMonitoring(); - flags.connected_okay = true; - ++n_tries; - request->flags.pinned = true; - if (pinned_connection->pinnedAuth()) - request->flags.auth = true; + serverConn = pinned_connection ? pinned_connection->borrowPinnedConnection(request, serverDestinations[0]->getPeer()) : nullptr; + if (Comm::IsConnOpen(serverConn)) { + flags.connected_okay = true; + ++n_tries; + request->flags.pinned = true; - closeHandler = comm_add_close_handler(serverConn->fd, fwdServerClosedWrapper, this); + if (pinned_connection->pinnedAuth()) + request->flags.auth = true; - syncWithServerConn(pinned_connection->pinning.host); + closeHandler = comm_add_close_handler(serverConn->fd, fwdServerClosedWrapper, this); - // the server may close the pinned connection before this request - pconnRace = racePossible; - dispatch(); - return; - } + syncWithServerConn(pinned_connection->pinning.host); + + // the server may close the pinned connection before this request + pconnRace = racePossible; + dispatch(); + return; + } - } else - serverConn = nullptr; // Pinned connection failure. debugs(17,2,HERE << "Pinned connection failed: " << pinned_connection);