aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_handler.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-03-27 11:08:06 +0100
committerHans Nilsson <[email protected]>2014-03-27 11:08:06 +0100
commitd6b30f44ea610355dab47024acdcb9fc597f96cb (patch)
treee92d281c5501e87b8916f2133931b103d39e5cbc /lib/ssh/src/ssh_connection_handler.erl
parentbe5ad8be918b803d4224e8d6b17a508d2559b8a1 (diff)
parentfb908b7ceccaef70a46bb14db8da3e6e373a9810 (diff)
downloadotp-d6b30f44ea610355dab47024acdcb9fc597f96cb.tar.gz
otp-d6b30f44ea610355dab47024acdcb9fc597f96cb.tar.bz2
otp-d6b30f44ea610355dab47024acdcb9fc597f96cb.zip
Merge branch 'hans/ssh/login_hangs/OTP-11823'
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index d7fff14f92..322da50f21 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -110,8 +110,16 @@ start_connection(server = Role, Socket, Options, Timeout) ->
{ok, Pid} = ssh_connection_sup:start_child(ConnectionSup, [Role, Socket, Opts]),
{_, Callback, _} = proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
socket_control(Socket, Pid, Callback),
- Ref = erlang:monitor(process, Pid),
- handshake(Pid, Ref, Timeout)
+ case proplists:get_value(parallel_login, Opts, false) of
+ true ->
+ spawn(fun() ->
+ Ref = erlang:monitor(process, Pid),
+ handshake(Pid, Ref, Timeout)
+ end);
+ false ->
+ Ref = erlang:monitor(process, Pid),
+ handshake(Pid, Ref, Timeout)
+ end
catch
exit:{noproc, _} ->
{error, ssh_not_started};