]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
FwdState::connectStart() cleanup
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 4 Nov 2016 16:48:53 +0000 (18:48 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 4 Nov 2016 16:48:53 +0000 (18:48 +0200)
 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

src/FwdState.cc

index c78019202a88c05388bc671f0ab284a23aed1e35..da6927b598c57e34689b744c65983b8ac72c0704 100644 (file)
@@ -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);