aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-09-16 10:48:22 +0200
committerIngela Anderton Andin <[email protected]>2015-09-16 10:48:22 +0200
commitc019481b3ff418de76886b955ba9238a12ea856a (patch)
tree9d958a8db8aca4632efcb3bfabf64c53995258e6 /lib/ssl/src
parenta12b70fa98eee10650c9de78d7d91516a2989999 (diff)
parentb2c0bef3cff85784b2ccb3b91bbea997acab6187 (diff)
downloadotp-c019481b3ff418de76886b955ba9238a12ea856a.tar.gz
otp-c019481b3ff418de76886b955ba9238a12ea856a.tar.bz2
otp-c019481b3ff418de76886b955ba9238a12ea856a.zip
Merge branch 'ia/ssl/register-unique-session/OTP-12980' into maint
* ia/ssl/register-unique-session/OTP-12980: ssl: Correct return value of default session callback module
Diffstat (limited to 'lib/ssl/src')
-rw-r--r--lib/ssl/src/ssl_session.erl4
-rw-r--r--lib/ssl/src/ssl_session_cache.erl2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl
index 1770faf1ff..0d6cc93a20 100644
--- a/lib/ssl/src/ssl_session.erl
+++ b/lib/ssl/src/ssl_session.erl
@@ -100,14 +100,14 @@ select_session([], _, _) ->
no_session;
select_session(Sessions, #ssl_options{ciphers = Ciphers}, OwnCert) ->
IsNotResumable =
- fun([_Id, Session]) ->
+ fun(Session) ->
not (resumable(Session#session.is_resumable) andalso
lists:member(Session#session.cipher_suite, Ciphers)
andalso (OwnCert == Session#session.own_certificate))
end,
case lists:dropwhile(IsNotResumable, Sessions) of
[] -> no_session;
- [[Id, _]|_] -> Id
+ [Session | _] -> Session#session.session_id
end.
is_resumable(_, _, #ssl_options{reuse_sessions = false}, _, _, _, _) ->
diff --git a/lib/ssl/src/ssl_session_cache.erl b/lib/ssl/src/ssl_session_cache.erl
index 11ed310477..cfc48cd935 100644
--- a/lib/ssl/src/ssl_session_cache.erl
+++ b/lib/ssl/src/ssl_session_cache.erl
@@ -83,7 +83,7 @@ foldl(Fun, Acc0, Cache) ->
%%--------------------------------------------------------------------
select_session(Cache, PartialKey) ->
ets:select(Cache,
- [{{{PartialKey,'$1'}, '$2'},[],['$$']}]).
+ [{{{PartialKey,'_'}, '$1'},[],['$1']}]).
%%--------------------------------------------------------------------
%%% Internal functions