diff options
author | Ingela Anderton Andin <[email protected]> | 2015-06-02 09:14:18 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-06-03 14:22:42 +0200 |
commit | 051a662cdc5cfc2aa93d86119688c14743837a5f (patch) | |
tree | 9b6f585473696e64f4c856b9401a148fe4e07409 /lib/ssh/src/ssh_acceptor.erl | |
parent | 2c323bd46cecd0592a47e32e4b57f3b6600b828d (diff) | |
download | otp-051a662cdc5cfc2aa93d86119688c14743837a5f.tar.gz otp-051a662cdc5cfc2aa93d86119688c14743837a5f.tar.bz2 otp-051a662cdc5cfc2aa93d86119688c14743837a5f.zip |
ssh: Add profile option
To enable the ssh daemon to run in a virtualized environment, where
there can be more that one server that has the same ip-address
and port, we add a new option profile. The profile name will be
used in concatenation with ip-address and port to identify the
ssh daemon instance.
The name profile was chosen as there is a similar concept in the HTTP client
in inets where profile names can be used to instantiate client configurations.
Also the same type of option has been added to the HTTP server in inets.
Diffstat (limited to 'lib/ssh/src/ssh_acceptor.erl')
-rw-r--r-- | lib/ssh/src/ssh_acceptor.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl index 34988f17b6..6c431af270 100644 --- a/lib/ssh/src/ssh_acceptor.erl +++ b/lib/ssh/src/ssh_acceptor.erl @@ -21,6 +21,8 @@ -module(ssh_acceptor). +-include("ssh.hrl"). + %% Internal application API -export([start_link/5, number_of_connections/1]). @@ -82,8 +84,10 @@ acceptor_loop(Callback, Port, Address, Opts, ListenSocket, AcceptTimeout) -> end. handle_connection(Callback, Address, Port, Options, Socket) -> - SystemSup = ssh_system_sup:system_supervisor(Address, Port), SSHopts = proplists:get_value(ssh_opts, Options, []), + Profile = proplists:get_value(profile, SSHopts, ?DEFAULT_PROFILE), + SystemSup = ssh_system_sup:system_supervisor(Address, Port, Profile), + MaxSessions = proplists:get_value(max_sessions,SSHopts,infinity), case number_of_connections(SystemSup) < MaxSessions of true -> |