aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-05-05 10:36:34 +0200
committerHans Nilsson <[email protected]>2014-05-09 11:13:42 +0200
commit36d05de60f767d6931b76b13060d73789c16e7aa (patch)
treedaf774c58e8e871dfd82aca9ebcaf6173de0374a /lib/ssh/src/ssh.erl
parent77ab185507c597112dd5039176ed5d9c65e84632 (diff)
downloadotp-36d05de60f767d6931b76b13060d73789c16e7aa.tar.gz
otp-36d05de60f767d6931b76b13060d73789c16e7aa.tar.bz2
otp-36d05de60f767d6931b76b13060d73789c16e7aa.zip
ssh: Use correct timeout value for the connection timeout
Diffstat (limited to 'lib/ssh/src/ssh.erl')
-rw-r--r--lib/ssh/src/ssh.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 75081b7a61..240de69eff 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -1,7 +1,7 @@
%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -73,8 +73,9 @@ connect(Host, Port, Options, Timeout) ->
{SocketOptions, SshOptions} ->
{_, Transport, _} = TransportOpts =
proplists:get_value(transport, Options, {tcp, gen_tcp, tcp_closed}),
+ ConnectionTimeout = proplists:get_value(connect_timeout, Options, infinity),
Inet = proplists:get_value(inet, SshOptions, inet),
- try Transport:connect(Host, Port, [ {active, false}, Inet | SocketOptions], Timeout) of
+ try Transport:connect(Host, Port, [ {active, false}, Inet | SocketOptions], ConnectionTimeout) of
{ok, Socket} ->
Opts = [{user_pid, self()}, {host, Host} | fix_idle_time(SshOptions)],
ssh_connection_handler:start_connection(client, Socket, Opts, Timeout);