Browse Source

Inline timeout function, avoiding declaration in conditional

Moving it out would require an anonymous function, or bind(), anyway.
Luckily It's a tiny function. Fixes crash in strict mode.
v0.8.7-release
Jonas Westerlund 12 years ago
committed by Nathan Rajlich
parent
commit
4cfdc57712
  1. 5
      lib/tls.js

5
lib/tls.js

@ -574,11 +574,10 @@ function onhandshakestart() {
var self = this, ssl = this.ssl;
if (ssl.timer === null) {
function timeout() {
ssl.timer = setTimeout(function timeout() {
ssl.handshakes = 0;
ssl.timer = null;
}
ssl.timer = setTimeout(timeout, exports.CLIENT_RENEG_WINDOW * 1000);
}, exports.CLIENT_RENEG_WINDOW * 1000);
}
else if (++ssl.handshakes > exports.CLIENT_RENEG_LIMIT) {
// Defer the error event to the next tick. We're being called from OpenSSL's

Loading…
Cancel
Save