aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-10-02 15:55:10 +0200
committerErlang/OTP <[email protected]>2017-10-02 15:55:10 +0200
commit767fe3ce59eecbd8f8dac911a9117b1c265ce527 (patch)
tree31a2ee60214ecf438146eb347c2db86f88c4e6b9
parent8a62e04d1283c450ad1fc440b57b87afca9f01d6 (diff)
parentd30fa857278e011f95a0707944a566a26ac6d09c (diff)
downloadotp-767fe3ce59eecbd8f8dac911a9117b1c265ce527.tar.gz
otp-767fe3ce59eecbd8f8dac911a9117b1c265ce527.tar.bz2
otp-767fe3ce59eecbd8f8dac911a9117b1c265ce527.zip
Merge branch 'hans/ssh/printout_crash/OTP-14645' into maint-20
* hans/ssh/printout_crash/OTP-14645: ssh: fix broken printouts
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 8d3ddb09a4..4158a52a27 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -1357,6 +1357,7 @@ handle_event(info, UnexpectedMessage, StateName, D = #data{ssh_params = Ssh}) ->
report ->
Msg = lists:flatten(
io_lib:format(
+ "*** SSH: "
"Unexpected message '~p' received in state '~p'\n"
"Role: ~p\n"
"Peer: ~p\n"
@@ -1365,7 +1366,7 @@ handle_event(info, UnexpectedMessage, StateName, D = #data{ssh_params = Ssh}) ->
StateName,
Ssh#ssh.role,
Ssh#ssh.peer,
- ?GET_INTERNAL_OPT(address, Ssh#ssh.opts)])),
+ ?GET_INTERNAL_OPT(address, Ssh#ssh.opts, undefined)])),
error_logger:info_report(Msg),
keep_state_and_data;
@@ -1374,7 +1375,8 @@ handle_event(info, UnexpectedMessage, StateName, D = #data{ssh_params = Ssh}) ->
Other ->
Msg = lists:flatten(
- io_lib:format("Call to fun in 'unexpectedfun' failed:~n"
+ io_lib:format("*** SSH: "
+ "Call to fun in 'unexpectedfun' failed:~n"
"Return: ~p\n"
"Message: ~p\n"
"Role: ~p\n"
@@ -1383,8 +1385,8 @@ handle_event(info, UnexpectedMessage, StateName, D = #data{ssh_params = Ssh}) ->
[Other,
UnexpectedMessage,
Ssh#ssh.role,
- element(2,Ssh#ssh.peer),
- ?GET_INTERNAL_OPT(address, Ssh#ssh.opts)]
+ Ssh#ssh.peer,
+ ?GET_INTERNAL_OPT(address, Ssh#ssh.opts, undefined)]
)),
error_logger:error_report(Msg),
keep_state_and_data