diff options
author | Ingela Anderton Andin <[email protected]> | 2014-06-17 11:30:25 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-06-17 11:30:25 +0200 |
commit | e2961080386045f3e4ef59d9895b680ccdc4fbe4 (patch) | |
tree | 70b48a302eb0b6c0d813a4b09f2bdd93f3cba6bc /lib/ssl/src/ssl_manager.erl | |
parent | a182917681b28ec7129adf73d863fa6b11670c10 (diff) | |
parent | 27a8fdfe9300827d55ec12f65e49e84bdfc264cd (diff) | |
download | otp-e2961080386045f3e4ef59d9895b680ccdc4fbe4.tar.gz otp-e2961080386045f3e4ef59d9895b680ccdc4fbe4.tar.bz2 otp-e2961080386045f3e4ef59d9895b680ccdc4fbe4.zip |
Merge branch 'ia/ssl/revert-due-to-performance-issue' into maint
* ia/ssl/revert-due-to-performance-issue:
Revert "ssl: Avoid creating a huge session table"
Diffstat (limited to 'lib/ssl/src/ssl_manager.erl')
-rw-r--r-- | lib/ssl/src/ssl_manager.erl | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index 66dfdf86a9..d6e5064c39 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2014. All Rights Reserved. +%% Copyright Ericsson AB 2007-2013. 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 @@ -282,13 +282,8 @@ handle_cast({register_session, Host, Port, Session}, session_cache_cb = CacheCb} = State) -> TimeStamp = calendar:datetime_to_gregorian_seconds({date(), time()}), NewSession = Session#session{time_stamp = TimeStamp}, - case CacheCb:select_session(Cache, {Host, Port}) of - no_session -> - CacheCb:update(Cache, {{Host, Port}, - NewSession#session.session_id}, NewSession); - Sessions -> - register_unique_session(Sessions, NewSession, CacheCb, Cache, {Host, Port}) - end, + CacheCb:update(Cache, {{Host, Port}, + NewSession#session.session_id}, NewSession), {noreply, State}; handle_cast({register_session, Port, Session}, @@ -499,34 +494,3 @@ clean_cert_db(Ref, CertDb, RefDb, PemCache, File) -> _ -> ok end. - -%% Do not let dumb clients create a gigantic session table -register_unique_session(Sessions, Session, CacheCb, Cache, PartialKey) -> - case exists_equivalent(Session , Sessions) of - true -> - ok; - false -> - CacheCb:update(Cache, {PartialKey, - Session#session.session_id}, Session) - end. - -exists_equivalent(_, []) -> - false; -exists_equivalent(#session{ - peer_certificate = PeerCert, - own_certificate = OwnCert, - compression_method = Compress, - cipher_suite = CipherSuite, - srp_username = SRP, - ecc = ECC} , - [#session{ - peer_certificate = PeerCert, - own_certificate = OwnCert, - compression_method = Compress, - cipher_suite = CipherSuite, - srp_username = SRP, - ecc = ECC} | _]) -> - true; -exists_equivalent(Session, [ _ | Rest]) -> - exists_equivalent(Session, Rest). - |