Skip to content

Commit

Permalink
ssh: Function to replace options in a running daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
HansN committed Aug 8, 2022
1 parent fe87250 commit 508f1f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/ssh/src/ssh.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
channel_info/3,
daemon/1, daemon/2, daemon/3,
daemon_info/1, daemon_info/2,
daemon_replace_options/2,
set_sock_opts/2, get_sock_opts/2,
default_algorithms/0,
chk_algos_opts/1,
Expand Down Expand Up @@ -442,6 +443,17 @@ daemon(Host0, Port0, UserOptions0) when 0 =< Port0, Port0 =< 65535,
daemon(_, _, _) ->
{error, badarg}.

%%--------------------------------------------------------------------
-spec daemon_replace_options(DaemonRef, NewUserOptions) -> {ok,daemon_ref()}
| {error,term()} when
DaemonRef :: daemon_ref(),
NewUserOptions :: daemon_options().

daemon_replace_options(DaemonRef, NewUserOptions) ->
{ok,Os0} = ssh_system_sup:get_acceptor_options(DaemonRef),
Os1 = ssh_options:merge_options(server, NewUserOptions, Os0),
ssh_system_sup:replace_acceptor_options(DaemonRef, Os1).

%%--------------------------------------------------------------------
-type daemon_info_tuple() ::
{port, inet:port_number()}
Expand Down

0 comments on commit 508f1f9

Please sign in to comment.