]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Prevent all TUNNELs being marked as ABORTED
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 17 Nov 2015 10:14:15 +0000 (02:14 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 17 Nov 2015 10:14:15 +0000 (02:14 -0800)
TUNNEL transactions are naturally ended by one of the client or server
closing the connection. This is not an abort. So finish the CONNECT
message context cleanly when the tunnel is closed.

src/tunnel.cc

index 35a6f9f1c40a0b9e70b6dc7668f35ff4070086f6..8a160f1e65623da3bc786a09880a2b4c0edc99af 100644 (file)
@@ -242,6 +242,10 @@ tunnelServerClosed(const CommCloseCbParams &params)
         tunnelState->request->hier.stopPeerClock(false);
 
     if (tunnelState->noConnections()) {
+        // ConnStateData pipeline should contain the CONNECT we are performing
+        auto ctx = tunnelState->http->getConn()->pipeline.front();
+        if (ctx != nullptr)
+            ctx->finished();
         delete tunnelState;
         return;
     }
@@ -261,6 +265,10 @@ tunnelClientClosed(const CommCloseCbParams &params)
     tunnelState->client.writer = NULL;
 
     if (tunnelState->noConnections()) {
+        // ConnStateData pipeline should contain the CONNECT we are performing
+        auto ctx = tunnelState->http->getConn()->pipeline.front();
+        if (ctx != nullptr)
+            ctx->finished();
         delete tunnelState;
         return;
     }