aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-08-24 11:35:34 +0200
committerIngela Anderton Andin <[email protected]>2017-09-04 10:09:13 +0200
commitd7cd38006fbcbfe10fdee5b26bfffd644fadeb41 (patch)
treed4a0da0c69e944a18b73c9bce194ab4d8fce0390
parented70ed1cbcfb01a8fee4ceac83c47afd78777387 (diff)
downloadotp-d7cd38006fbcbfe10fdee5b26bfffd644fadeb41.tar.gz
otp-d7cd38006fbcbfe10fdee5b26bfffd644fadeb41.tar.bz2
otp-d7cd38006fbcbfe10fdee5b26bfffd644fadeb41.zip
ssl: Mend Max session handling
The commit 256e01ce80b3aadd63f303b9bda5722ad313220f was a misunderstanding that actually broke the implementation. It is not so important to keep specific max, rather max is a threshold when the table should be shrinked as to not grow indefinitely. New sessions are created when the id is created and may be short lived it they are not registered for reuse due to handshake failure.
-rw-r--r--lib/ssl/src/ssl_manager.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl
index ca9aaf4660..ef7c3de7af 100644
--- a/lib/ssl/src/ssl_manager.erl
+++ b/lib/ssl/src/ssl_manager.erl
@@ -563,7 +563,7 @@ server_register_session(Port, Session, #state{session_cache_server_max = Max,
do_register_session(Key, Session, Max, Pid, Cache, CacheCb) ->
try CacheCb:size(Cache) of
- Max ->
+ Size when Size >= Max ->
invalidate_session_cache(Pid, CacheCb, Cache);
_ ->
CacheCb:update(Cache, Key, Session),