aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-04-20 11:51:05 +0200
committerHans Nilsson <[email protected]>2018-04-20 11:51:05 +0200
commit0343b68b053ee97b2ef70ea07b9aa87e8842c591 (patch)
tree27e2f211cb8082896699873dce95fa71f2c3f8b7 /lib/ssh/src
parentf15f615f9185077b02c011ac28257e8365c01e75 (diff)
parentf2c1d537dc28ffbde5d42aedec70bf4c6574c3ea (diff)
downloadotp-0343b68b053ee97b2ef70ea07b9aa87e8842c591.tar.gz
otp-0343b68b053ee97b2ef70ea07b9aa87e8842c591.tar.bz2
otp-0343b68b053ee97b2ef70ea07b9aa87e8842c591.zip
Merge branch 'maint-20' into maint
* maint-20: Updated OTP version Prepare release erl_interface: Optimize latin1_to_utf8 and friend inets: Fix broken httpc options handling erl_interface: Fix ei_connect ssh: Fix server crashes for exit-normal signals ssh: Fix ssh_sftpd:handle_op not returning State ic: Optimize oe_ei_encode_atom
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index e11d3adee4..ad23d82ea8 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -1379,8 +1379,21 @@ handle_event(info, {'DOWN', _Ref, process, ChannelPid, _Reason}, _, D0) ->
{keep_state, D, Repls};
%%% So that terminate will be run when supervisor is shutdown
-handle_event(info, {'EXIT', _Sup, Reason}, _, _) ->
- {stop, {shutdown, Reason}};
+handle_event(info, {'EXIT', _Sup, Reason}, StateName, _) ->
+ Role = role(StateName),
+ if
+ Role == client ->
+ %% OTP-8111 tells this function clause fixes a problem in
+ %% clients, but there were no check for that role.
+ {stop, {shutdown, Reason}};
+
+ Reason == normal ->
+ %% An exit normal should not cause a server to crash. This has happend...
+ keep_state_and_data;
+
+ true ->
+ {stop, {shutdown, Reason}}
+ end;
handle_event(info, check_cache, _, D) ->
{keep_state, cache_check_set_idle_timer(D)};