aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test/ssh_peername_sockname_server.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-11-06 10:54:02 +0100
committerIngela Anderton Andin <[email protected]>2013-11-13 10:58:20 +0100
commit422ed9ecd9c95c25964381b7ca2888a0320a8ee4 (patch)
treeb501003998429de1850d0b067f285dcfbd8dcf18 /lib/ssh/test/ssh_peername_sockname_server.erl
parent24f37acef3e7e33576bcd071569a94de980b6544 (diff)
downloadotp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.tar.gz
otp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.tar.bz2
otp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.zip
ssh: Simplify handling of connection attributes (e.i. user and sockname)
OTP-11296
Diffstat (limited to 'lib/ssh/test/ssh_peername_sockname_server.erl')
-rw-r--r--lib/ssh/test/ssh_peername_sockname_server.erl8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ssh/test/ssh_peername_sockname_server.erl b/lib/ssh/test/ssh_peername_sockname_server.erl
index 7664f3ee25..bc505695d3 100644
--- a/lib/ssh/test/ssh_peername_sockname_server.erl
+++ b/lib/ssh/test/ssh_peername_sockname_server.erl
@@ -34,12 +34,10 @@ init([]) ->
{ok, #state{}}.
handle_msg({ssh_channel_up, ChannelId, ConnectionManager}, State) ->
+ [{peer, {_Name, Peer}}] = ssh:connection_info(ConnectionManager, [peer]),
+ [{sockname, Sock}] = ssh:connection_info(ConnectionManager, [sockname]),
ssh_connection:send(ConnectionManager, ChannelId,
- term_to_binary(
- {catch ssh:peername(ConnectionManager),
- catch ssh:sockname(ConnectionManager)
- })
- ),
+ term_to_binary({Peer, Sock})),
{ok, State}.
handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, _, _Error, _}},