From 1c22f3cb6a170183fd3c8e938162a01bc82a2677 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Fri, 27 Apr 2018 14:40:20 +0200 Subject: ssh: idle_timer sends special msg instead of EXIT --- lib/ssh/src/ssh_connection_handler.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index dfdad769ed..311c5a2cd6 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -1424,6 +1424,10 @@ handle_event(info, {timeout, {_, From} = Request}, _, handle_event(info, {'DOWN', _Ref, process, ChannelPid, _Reason}, _, D0) -> {keep_state, handle_channel_down(ChannelPid, D0)}; + +handle_event(info, idle_timer_timeout, StateName, _) -> + {stop, {shutdown, "Timeout"}}; + %%% So that terminate will be run when supervisor is shutdown handle_event(info, {'EXIT', _Sup, Reason}, StateName, _) -> Role = role(StateName), @@ -2157,7 +2161,7 @@ cache_check_set_idle_timer(D = #data{idle_timer_ref = undefined, %% Yes, we'll set one since the cache is empty and it should not %% be that for a specified time D#data{idle_timer_ref = - erlang:send_after(IdleTime, self(), {'EXIT',[],"Timeout"})}; + erlang:send_after(IdleTime, self(), idle_timer_timeout)}; _ -> %% No - there are entries in the cache D -- cgit v1.2.3