aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_handler.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-04-20 11:53:39 +0200
committerHans Nilsson <[email protected]>2018-04-20 11:53:39 +0200
commit38be1e447d1a64aa528ecae2d5e957d21e069019 (patch)
tree8e57a39c8773cfe7e3c13bf14bac09241b879656 /lib/ssh/src/ssh_connection_handler.erl
parent21754c8d402855af5081dad0aff465a8f0f7eda7 (diff)
parent0343b68b053ee97b2ef70ea07b9aa87e8842c591 (diff)
downloadotp-38be1e447d1a64aa528ecae2d5e957d21e069019.tar.gz
otp-38be1e447d1a64aa528ecae2d5e957d21e069019.tar.bz2
otp-38be1e447d1a64aa528ecae2d5e957d21e069019.zip
Merge branch 'maint'
* maint: Updated OTP version Prepare release inets: Fix broken httpc options handling ssh: Fix server crashes for exit-normal signals ssh: Fix ssh_sftpd:handle_op not returning State Conflicts: OTP_VERSION
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-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 4261e5bf13..033f11f4a1 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -1420,8 +1420,21 @@ handle_event(info, {'DOWN', _Ref, process, ChannelPid, _Reason}, _, D0) ->
{keep_state, handle_channel_down(ChannelPid, D0)};
%%% 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)};