tls: Trivial use_strict fix

This commit is contained in:
isaacs 2013-07-14 20:08:07 -07:00
parent 875dd37a93
commit e48536f4cd

View File

@ -646,15 +646,16 @@ CryptoStream.prototype.destroySoon = function(err) {
// was written on this side was read from the other side. // was written on this side was read from the other side.
var self = this; var self = this;
var waiting = 1; var waiting = 1;
function finish() {
if (--waiting === 0) self.destroy();
}
this._opposite.once('end', finish); this._opposite.once('end', finish);
if (!this._finished) { if (!this._finished) {
this.once('finish', finish); this.once('finish', finish);
++waiting; ++waiting;
} }
} }
function finish() {
if (--waiting === 0) self.destroy();
}
}; };