aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_acceptor.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-03-26 16:30:50 +0100
committerHans Nilsson <[email protected]>2014-03-26 16:35:51 +0100
commit2da14af988d563b5c53f42334e990f4c9021dd7a (patch)
tree43b6468bdf303a7950436865e75c8eeef360d325 /lib/ssh/src/ssh_acceptor.erl
parent978f3cbfa9eb46dcb6987e2b0ce5b4b7727dd17b (diff)
downloadotp-2da14af988d563b5c53f42334e990f4c9021dd7a.tar.gz
otp-2da14af988d563b5c53f42334e990f4c9021dd7a.tar.bz2
otp-2da14af988d563b5c53f42334e990f4c9021dd7a.zip
ssh: Added option negotiation_timeout for ssh:daemon
This option is for closing a connection where the client connects, but then do nothing except keeping server resources.
Diffstat (limited to 'lib/ssh/src/ssh_acceptor.erl')
-rw-r--r--lib/ssh/src/ssh_acceptor.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index 91905b2eaf..e57b07cee8 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -84,11 +84,14 @@ handle_connection(_Callback, Address, Port, Options, Socket) ->
SystemSup = ssh_system_sup:system_supervisor(Address, Port),
{ok, SubSysSup} = ssh_system_sup:start_subsystem(SystemSup, Options),
ConnectionSup = ssh_subsystem_sup:connection_supervisor(SubSysSup),
+ Timeout = proplists:get_value(negotiation_timeout,
+ proplists:get_value(ssh_opts, Options, []),
+ 2*60*1000),
ssh_connection_handler:start_connection(server, Socket,
[{supervisors, [{system_sup, SystemSup},
{subsystem_sup, SubSysSup},
{connection_sup, ConnectionSup}]}
- | Options], infinity).
+ | Options], Timeout).
handle_error(timeout) ->
ok;