From b788929349f4eec4980dd2181d92f7df3687db85 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Wed, 31 Oct 2012 09:34:18 +0100 Subject: handle no idle-timer on check cache --- lib/ssh/src/ssh_connection_manager.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/ssh') 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. -- cgit v1.2.3