diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-03-14 14:42:01 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-03-14 14:47:41 -0700 |
commit | 36e75b7351c483cdc8ae281e9c43278836ea94f8 (patch) | |
tree | 704e53c3431777ca89e48c51872289b93a13487c /lib | |
parent | 9d4c5a12f499fd59156e16efce17f019e16708d8 (diff) | |
download | android-node-v8-36e75b7351c483cdc8ae281e9c43278836ea94f8.tar.gz android-node-v8-36e75b7351c483cdc8ae281e9c43278836ea94f8.tar.bz2 android-node-v8-36e75b7351c483cdc8ae281e9c43278836ea94f8.zip |
Fix HTTP agent disconnection problem
https://groups.google.com/forum/#!topic/nodejs-dev/V5fB69hFa9o
Closes GH-787.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js index 98a9ab9c87..8cc37ed47c 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1289,8 +1289,10 @@ Agent.prototype._establishNewConnection = function() { // All that should be required for keep-alive is to not reconnect, // but outgoingFlush instead. if (!req.shouldKeepAlive) { - debug('AGENT socket.end()'); - if (socket.writable) socket.end(); + if (socket.writable) { + debug('AGENT socket.destroySoon()'); + socket.destroySoon(); + } assert(!socket.writable); } else { debug('AGENT socket keep-alive'); |