From b37d0448db27aeaa364c7e2cd2017ed0596aa288 Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Sun, 29 Jan 2012 14:39:12 +0100 Subject: 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. --- lib/ssl/src/ssl_tls_dist_proxy.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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) -> -- cgit v1.2.3