Created
June 23, 2013 22:37
-
-
Save tjfontaine/7ab373992c16cbe8b4cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c9a02e427cf92819b99d69b60a038372516a8301 Mon Sep 17 00:00:00 2001 | |
From: Timothy J Fontaine <tjfontaine@gmail.com> | |
Date: Sun, 23 Jun 2013 22:33:13 +0000 | |
Subject: [PATCH] tls: only wait for finish if we haven't seen it | |
--- | |
lib/tls.js | 5 ++++- | |
1 file changed, 4 insertions(+), 1 deletion(-) | |
diff --git a/lib/tls.js b/lib/tls.js | |
index 4d222f3..469548a 100644 | |
--- a/lib/tls.js | |
+++ b/lib/tls.js | |
@@ -650,7 +650,10 @@ CryptoStream.prototype.destroySoon = function(err) { | |
if (--waiting === 0) self.destroy(); | |
} | |
this._opposite.once('end', finish); | |
- this.once('finish', finish); | |
+ if (!this._finished) | |
+ this.once('finish', finish); | |
+ else | |
+ --waiting; | |
} | |
}; | |
-- | |
1.7.10.5 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment