diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2018-02-04 11:51:18 -0500 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-02-07 12:21:42 -0500 |
commit | 92ba624fa1da61c4061aa554877bfa3c94c83324 (patch) | |
tree | e677724a0cdd1339f5af30fbbb5417018546302b /lib/_tls_wrap.js | |
parent | 1573e4563a0d3f6c08a1dd3ab3d161bece532db5 (diff) | |
download | android-node-v8-92ba624fa1da61c4061aa554877bfa3c94c83324.tar.gz android-node-v8-92ba624fa1da61c4061aa554877bfa3c94c83324.tar.bz2 android-node-v8-92ba624fa1da61c4061aa554877bfa3c94c83324.zip |
tls: provide now value from C++
Instead of separately calling into C++ from JS to retrieve
the Timer.now() value, pass it in as an argument.
PR-URL: https://github.com/nodejs/node/pull/18562
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r-- | lib/_tls_wrap.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 16d8b24c29..fcd447bb59 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -32,7 +32,6 @@ const common = require('_tls_common'); const { StreamWrap } = require('_stream_wrap'); const { Buffer } = require('buffer'); const debug = util.debuglog('tls'); -const { Timer } = process.binding('timer_wrap'); const tls_wrap = process.binding('tls_wrap'); const { TCP, constants: TCPConstants } = process.binding('tcp_wrap'); const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap'); @@ -49,14 +48,13 @@ const kSNICallback = Symbol('snicallback'); const noop = () => {}; -function onhandshakestart() { +function onhandshakestart(now) { debug('onhandshakestart'); - const owner = this.owner; - const now = Timer.now(); - assert(now >= this.lastHandshakeTime); + const owner = this.owner; + if ((now - this.lastHandshakeTime) >= tls.CLIENT_RENEG_WINDOW * 1000) { this.handshakes = 0; } |