diff options
author | Ingela Anderton Andin <[email protected]> | 2015-11-13 21:56:30 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-12-03 14:45:27 +0100 |
commit | 5e95fdff6589432327e38415fc9c5545231e7961 (patch) | |
tree | 6f4eec5566bb8a5142c76b3c2b9841abe3271aad /lib/ssl/src/ssl_manager.erl | |
parent | c2548c79af951a8628b3e44de79652bc923188f0 (diff) | |
download | otp-5e95fdff6589432327e38415fc9c5545231e7961.tar.gz otp-5e95fdff6589432327e38415fc9c5545231e7961.tar.bz2 otp-5e95fdff6589432327e38415fc9c5545231e7961.zip |
ssl: Measure elapsed time with erlang:monotonic_time
Diffstat (limited to 'lib/ssl/src/ssl_manager.erl')
-rw-r--r-- | lib/ssl/src/ssl_manager.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index cc15678f23..9e535104f7 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -320,7 +320,7 @@ handle_call({unconditionally_clear_pem_cache, _},_, #state{certificate_db = [_,_ handle_cast({register_session, Host, Port, Session}, #state{session_cache_client = Cache, session_cache_cb = CacheCb} = State) -> - TimeStamp = calendar:datetime_to_gregorian_seconds({date(), time()}), + TimeStamp = erlang:monotonic_time(), NewSession = Session#session{time_stamp = TimeStamp}, case CacheCb:select_session(Cache, {Host, Port}) of @@ -335,7 +335,7 @@ handle_cast({register_session, Host, Port, Session}, handle_cast({register_session, Port, Session}, #state{session_cache_server = Cache, session_cache_cb = CacheCb} = State) -> - TimeStamp = calendar:datetime_to_gregorian_seconds({date(), time()}), + TimeStamp = erlang:monotonic_time(), NewSession = Session#session{time_stamp = TimeStamp}, CacheCb:update(Cache, {Port, NewSession#session.session_id}, NewSession), {noreply, State}; @@ -502,7 +502,7 @@ invalidate_session(Cache, CacheCb, Key, Session, #state{last_delay_timer = LastT #session{is_resumable = new} -> CacheCb:delete(Cache, Key), {noreply, State}; - _ -> + _ -> %% When a registered session is invalidated we need to wait a while before deleting %% it as there might be pending connections that rightfully needs to look %% up the session data but new connections should not get to use this session. @@ -530,7 +530,7 @@ new_id(Port, Tries, Cache, CacheCb) -> Id = crypto:rand_bytes(?NUM_OF_SESSION_ID_BYTES), case CacheCb:lookup(Cache, {Port, Id}) of undefined -> - Now = calendar:datetime_to_gregorian_seconds({date(), time()}), + Now = erlang:monotonic_time(), %% New sessions can not be set to resumable %% until handshake is compleate and the %% other session values are set. |