From: hno <> Date: Tue, 25 Sep 2007 19:23:13 +0000 (+0000) Subject: Close CONNECT tunnels on abort X-Git-Tag: SQUID_3_0_RC1~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71a2ced6ec8993c34bdba322419f8d604408ca34;p=thirdparty%2Fsquid.git Close CONNECT tunnels on abort CONNECT tunnels could get stuck on abort --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 02e35a8787..dea3b204a6 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.173 2007/08/13 17:20:51 hno Exp $ + * $Id: tunnel.cc,v 1.174 2007/09/25 13:23:13 hno Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -134,8 +134,15 @@ tunnelServerClosed(int fd, void *data) assert(fd == tunnelState->server.fd()); tunnelState->server.fd(-1); - if (tunnelState->noConnections()) + if (tunnelState->noConnections()) { tunnelStateFree(tunnelState); + return; + } + + if (!tunnelState->server.len) { + comm_close(tunnelState->client.fd()); + return; + } } static void @@ -146,8 +153,15 @@ tunnelClientClosed(int fd, void *data) assert(fd == tunnelState->client.fd()); tunnelState->client.fd(-1); - if (tunnelState->noConnections()) + if (tunnelState->noConnections()) { tunnelStateFree(tunnelState); + return; + } + + if (!tunnelState->client.len) { + comm_close(tunnelState->server.fd()); + return; + } } static void