aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Guyot <[email protected]>2012-01-29 14:39:12 +0100
committerPaul Guyot <[email protected]>2012-01-29 14:39:12 +0100
commitb37d0448db27aeaa364c7e2cd2017ed0596aa288 (patch)
tree4e9109de7aac8f9ec3f219c4fe04be0bcd8d9273
parentf9ca630a95e1e2adb1b225bfb69e3101678183f3 (diff)
downloadotp-b37d0448db27aeaa364c7e2cd2017ed0596aa288.tar.gz
otp-b37d0448db27aeaa364c7e2cd2017ed0596aa288.tar.bz2
otp-b37d0448db27aeaa364c7e2cd2017ed0596aa288.zip
Fix setup loop of SSL TLS dist proxy
The proxy socket or the SSL socket can be closed during the setup phase. In such situations, the proxy processes must exit nicely, to avoid any leak of processes waiting forever for data from closed sockets.
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
index d63eada571..61fabeb916 100644
--- a/lib/ssl/src/ssl_tls_dist_proxy.erl
+++ b/lib/ssl/src/ssl_tls_dist_proxy.erl
@@ -223,7 +223,11 @@ loop_conn_setup(World, Erts) ->
loop_conn_setup(World, Erts);
{tcp, Erts, Data} ->
ssl:send(World, Data),
- loop_conn_setup(World, Erts)
+ loop_conn_setup(World, Erts);
+ {tcp_closed, Erts} ->
+ ssl:close(World);
+ {ssl_closed, World} ->
+ gen_tcp:close(Erts)
end.
loop_conn(World, Erts) ->