aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-09 17:43:42 +0100
committerHans Nilsson <[email protected]>2017-03-09 17:43:42 +0100
commit55916696a0bb867cbe55fc042744d8e03258db05 (patch)
tree450dd35f4a031a6af67eab86b1200ddb49af561c /lib
parentce6040f651c081f4cb7dfafe5c4bf49bfee7812f (diff)
parent5d560441709eb1faa6a223b237da65f1d70da6d2 (diff)
downloadotp-55916696a0bb867cbe55fc042744d8e03258db05.tar.gz
otp-55916696a0bb867cbe55fc042744d8e03258db05.tar.bz2
otp-55916696a0bb867cbe55fc042744d8e03258db05.zip
Merge branch 'hans/ssh/daemon_info_extension/OTP-14259'
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh/doc/src/ssh.xml3
-rw-r--r--lib/ssh/src/ssh.erl10
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index f6e26f5ee8..1f07e826ce 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -726,9 +726,10 @@
</func>
<func>
- <name>daemon_info(Daemon) -> {ok, [{port,Port}]} | {error,Error}</name>
+ <name>daemon_info(Daemon) -> {ok, [DaemonInfo]} | {error,Error}</name>
<fsummary>Get info about a daemon</fsummary>
<type>
+ <v>DaemonInfo = {port,Port::pos_integer()} | {listen_address, any|ip_address()} | {profile,atom()}</v>
<v>Port = integer()</v>
<v>Error = bad_daemon_ref</v>
</type>
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 53aba14458..e2a289d737 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -200,11 +200,13 @@ daemon(Host0, Port, UserOptions0) ->
daemon_info(Pid) ->
case catch ssh_system_sup:acceptor_supervisor(Pid) of
AsupPid when is_pid(AsupPid) ->
- [Port] =
- [Prt || {{ssh_acceptor_sup,any,Prt,default},
+ [{ListenAddr,Port,Profile}] =
+ [{LA,Prt,Prf} || {{ssh_acceptor_sup,LA,Prt,Prf},
_WorkerPid,worker,[ssh_acceptor]} <- supervisor:which_children(AsupPid)],
- {ok, [{port,Port}]};
-
+ {ok, [{port,Port},
+ {listen_address,ListenAddr},
+ {profile,Profile}
+ ]};
_ ->
{error,bad_daemon_ref}
end.