aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_manager.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_connection_manager.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_connection_manager.erl')
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index a2effc177e..cffeade485 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -178,7 +178,7 @@ send_eof(ConnectionManager, ChannelId) ->
%% {stop, Reason}
%% Description: Initiates the server
%%--------------------------------------------------------------------
-init([server, _Socket, Opts]) ->
+init([server, _Socket, Opts, SubSysSup]) ->
process_flag(trap_exit, true),
ssh_bits:install_messages(ssh_connection:messages()),
Cache = ssh_channel:cache_create(),
@@ -187,7 +187,8 @@ init([server, _Socket, Opts]) ->
channel_id_seed = 0,
port_bindings = [],
requests = [],
- channel_pids = []},
+ channel_pids = [],
+ sub_system_supervisor = SubSysSup},
opts = Opts,
connected = false}};
@@ -400,7 +401,7 @@ handle_call({close, ChannelId}, _,
end;
handle_call(stop, _, #state{role = _client,
- client = ChannelPid,
+ client = _ChannelPid,
connection = Pid} = State) ->
DisconnectMsg =
#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,