aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_session.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-11-13 21:56:30 +0100
committerIngela Anderton Andin <[email protected]>2015-12-03 14:45:27 +0100
commit5e95fdff6589432327e38415fc9c5545231e7961 (patch)
tree6f4eec5566bb8a5142c76b3c2b9841abe3271aad /lib/ssl/src/ssl_session.erl
parentc2548c79af951a8628b3e44de79652bc923188f0 (diff)
downloadotp-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_session.erl')
-rw-r--r--lib/ssl/src/ssl_session.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl
index 1849a05314..0ee8a096e9 100644
--- a/lib/ssl/src/ssl_session.erl
+++ b/lib/ssl/src/ssl_session.erl
@@ -66,8 +66,9 @@ client_id(ClientInfo, Cache, CacheCb, OwnCert) ->
%% Description: Check that the session has not expired
%%--------------------------------------------------------------------
valid_session(#session{time_stamp = TimeStamp}, LifeTime) ->
- Now = calendar:datetime_to_gregorian_seconds({date(), time()}),
- Now - TimeStamp < LifeTime.
+ Now = erlang:monotonic_time(),
+ Lived = erlang:convert_time_unit(Now-TimeStamp, native, seconds),
+ Lived < LifeTime.
server_id(Port, <<>>, _SslOpts, _Cert, _, _) ->
{ssl_manager:new_session_id(Port), undefined};