aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_acceptor.erl
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2010-05-26 14:38:02 +0000
committerErlang/OTP <[email protected]>2010-05-26 14:38:02 +0000
commit4aa5dadc3b966cffc2ffcaadf1b132f276afe75a (patch)
treec001ec03c821df005eafd3210b9098e0c3d4ff4c /lib/ssh/src/ssh_acceptor.erl
parent64943ba9de7ce7fa0ed75f9a6c3e7c472a07b8e0 (diff)
downloadotp-4aa5dadc3b966cffc2ffcaadf1b132f276afe75a.tar.gz
otp-4aa5dadc3b966cffc2ffcaadf1b132f276afe75a.tar.bz2
otp-4aa5dadc3b966cffc2ffcaadf1b132f276afe75a.zip
Fix race condition when an other connection is started before a channel is opened in the first connection.
Diffstat (limited to 'lib/ssh/src/ssh_acceptor.erl')
-rw-r--r--lib/ssh/src/ssh_acceptor.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index 57229daa27..9060626ab3 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -79,11 +79,11 @@ acceptor_loop(Callback, Port, Address, Opts, ListenSocket, AcceptTimeout) ->
handle_connection(Callback, Address, Port, Options, Socket) ->
SystemSup = ssh_system_sup:system_supervisor(Address, Port),
- ssh_system_sup:start_subsystem(SystemSup, Options),
+ {ok, SubSysSup} = ssh_system_sup:start_subsystem(SystemSup, Options),
ConnectionSup = ssh_system_sup:connection_supervisor(SystemSup),
{ok, Pid} =
ssh_connection_controler:start_manager_child(ConnectionSup,
- [server, Socket, Options]),
+ [server, Socket, Options, SubSysSup]),
Callback:controlling_process(Socket, Pid),
SshOpts = proplists:get_value(ssh_opts, Options),
Pid ! {start_connection, server, [Address, Port, Socket, SshOpts]}.