Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active December 13, 2015 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/4988981 to your computer and use it in GitHub Desktop.
Save isaacs/4988981 to your computer and use it in GitHub Desktop.
diff --git a/lib/tls.js b/lib/tls.js
index 8b3654f..0c5b1a5 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1306,6 +1306,10 @@ function pipe(pair, socket) {
// its data from the cleartext side, we have to give it a
// light kick to get in motion again.
socket.on('drain', function() {
+ if (pair.encrypted._pending)
+ pair.encrypted._writePending();
+ if (pair.cleartext._pending)
+ pair.cleartext._writePending();
pair.encrypted.read(0);
pair.cleartext.read(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment