diff options
author | Hans Nilsson <[email protected]> | 2016-04-26 12:45:49 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-04-27 13:39:05 +0200 |
commit | bbf8fb6e42e730a4037485c3313e63733d8c100b (patch) | |
tree | f2508bd40342708307857b83fd1f783536113bab /lib/ssh/src/ssh_channel.erl | |
parent | 73f90b506c5ceff51cd8a6f264dc8fe20dd9351d (diff) | |
download | otp-bbf8fb6e42e730a4037485c3313e63733d8c100b.tar.gz otp-bbf8fb6e42e730a4037485c3313e63733d8c100b.tar.bz2 otp-bbf8fb6e42e730a4037485c3313e63733d8c100b.zip |
ssh: Idle-timer refactoring and some cosmetics and inlineing
Diffstat (limited to 'lib/ssh/src/ssh_channel.erl')
-rw-r--r-- | lib/ssh/src/ssh_channel.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index de6908bb38..a8e6ebde16 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -68,7 +68,7 @@ %% Internal application API -export([cache_create/0, cache_lookup/2, cache_update/2, cache_delete/1, cache_delete/2, cache_foldl/3, - cache_find/2, + cache_info/2, cache_find/2, get_print_info/1]). -record(state, { @@ -335,6 +335,9 @@ cache_delete(Cache) -> cache_foldl(Fun, Acc, Cache) -> ets:foldl(Fun, Acc, Cache). +cache_info(num_entries, Cache) -> + proplists:get_value(size, ets:info(Cache)). + cache_find(ChannelPid, Cache) -> case ets:match_object(Cache, #channel{user = ChannelPid}) of [] -> |