From 71a2ced6ec8993c34bdba322419f8d604408ca34 Mon Sep 17 00:00:00 2001 From: hno <> Date: Tue, 25 Sep 2007 19:23:13 +0000 Subject: [PATCH] Close CONNECT tunnels on abort CONNECT tunnels could get stuck on abort --- src/tunnel.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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 -- 2.47.2