diff options
author | Ingela Anderton Andin <[email protected]> | 2014-08-11 17:22:36 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-10-13 12:11:49 +0200 |
commit | a60c126e813cdef73ff6fbd4dc5414f385d2c8c6 (patch) | |
tree | 01973d8a60f24f71e7c9ba9655442990fb2cdb3d /lib/ssl/src/ssl_session_cache.erl | |
parent | ef38e1b3082675fdd7ceea051995b764864d2dc7 (diff) | |
download | otp-a60c126e813cdef73ff6fbd4dc5414f385d2c8c6.tar.gz otp-a60c126e813cdef73ff6fbd4dc5414f385d2c8c6.tar.bz2 otp-a60c126e813cdef73ff6fbd4dc5414f385d2c8c6.zip |
ssl: Separate session cache for client and server
Even though in the most common case an erlang node will not be both client
and server, it may happen (for instance when running the erlang ditribution
over TLS).
Also try to mitigate the affect of dumb clients that could cause a
very lagre session cache on the client side that can cause long delays
in the client. The server will have other means to handle a large
session table and will not do any select operations on it anyhow.
Diffstat (limited to 'lib/ssl/src/ssl_session_cache.erl')
-rw-r--r-- | lib/ssl/src/ssl_session_cache.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ssl/src/ssl_session_cache.erl b/lib/ssl/src/ssl_session_cache.erl index 5c6ee3c54c..b011732f2c 100644 --- a/lib/ssl/src/ssl_session_cache.erl +++ b/lib/ssl/src/ssl_session_cache.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% Copyright Ericsson AB 2008-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 @@ -31,8 +31,8 @@ %%-------------------------------------------------------------------- %% Description: Return table reference. Called by ssl_manager process. %%-------------------------------------------------------------------- -init(_) -> - ets:new(cache_name(), [ordered_set, protected]). +init(Options) -> + ets:new(cache_name(proplists:get_value(role, Options)), [ordered_set, protected]). %%-------------------------------------------------------------------- %% Description: Handles cache table at termination of ssl manager. @@ -87,5 +87,5 @@ select_session(Cache, PartialKey) -> %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- -cache_name() -> - ssl_otp_session_cache. +cache_name(Name) -> + list_to_atom(atom_to_list(Name) ++ "_ssl_otp_session_cache"). |