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.
pull/24503/head
Jonas Westerlund 2012-07-04 23:17:14 +02:00 committed by Nathan Rajlich
parent 7e7d5d38ea
commit 4cfdc57712
1 changed files with 2 additions and 3 deletions

View File

@ -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