aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-10-31 09:34:18 +0100
committerFredrik Gustafsson <[email protected]>2012-10-31 10:56:25 +0100
commitb788929349f4eec4980dd2181d92f7df3687db85 (patch)
tree3861dd8acf9aaf96092d179225c87c55ae79ba2b /lib/ssh/src
parent7e6bfd3101d25d4a8061ab7a59002740ee021376 (diff)
downloadotp-b788929349f4eec4980dd2181d92f7df3687db85.tar.gz
otp-b788929349f4eec4980dd2181d92f7df3687db85.tar.bz2
otp-b788929349f4eec4980dd2181d92f7df3687db85.zip
handle no idle-timer on check cache
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index 2e62312423..6e2fe9da74 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -607,8 +607,15 @@ check_cache(State, Cache) ->
case proplists:get_value(size, ets:info(Cache)) of
0 ->
Opts = proplists:get_value(ssh_opts, State#state.opts),
- TimerRef = erlang:send_after(proplists:get_value(idle_time, Opts), self(), {'EXIT', [], "Timeout"}),
- State#state{idle_timer_ref=TimerRef};
+ case proplists:get_value(idle_time, Opts) of
+ infinity ->
+ State;
+ undefined ->
+ State;
+ Time ->
+ TimerRef = erlang:send_after(Time, self(), {'EXIT', [], "Timeout"}),
+ State#state{idle_timer_ref=TimerRef}
+ end;
_ ->
State
end.