Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save russellhaering/838272 to your computer and use it in GitHub Desktop.
Save russellhaering/838272 to your computer and use it in GitHub Desktop.
http: fix missing 'drain' events
From a0fec09da264671faa5be6d0ed0bbe3a716d08cd Mon Sep 17 00:00:00 2001
From: Russell Haering <russellhaering@gmail.com>
Date: Sat, 19 Feb 2011 16:00:05 -0800
Subject: [PATCH 1/2] http: fix missing 'drain' events
---
lib/http.js | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/http.js b/lib/http.js
index c208990..c9061ce 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -730,6 +730,7 @@ OutgoingMessage.prototype._flush = function() {
// This is a queue to the server or client to bring in the next this.
this._finish();
} else if (ret) {
+ // This is necessary to prevent https from breaking
this.emit('drain');
}
};
@@ -1339,6 +1340,7 @@ Agent.prototype._cycle = function() {
first._queue = null;
first.assignSocket(socket);
+ httpSocketSetup(socket);
self._cycle(); // try to dispatch another
return;
}
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment