Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fixes #1085. The agent end event may call detachSocket() after the so…
Browse files Browse the repository at this point in the history
…cket is detached and destroyed by abort(). This patch avoids that behavior.
  • Loading branch information
SaltwaterC authored and koichik committed Jul 14, 2011
1 parent 901ebed commit 5b02d56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,10 @@ Agent.prototype._establishNewConnection = function() {
debug('AGENT socket keep-alive');
}

req.detachSocket(socket);
// The socket may already be detached and destroyed by an abort call
if (socket._httpMessage) {
req.detachSocket(socket);
}

assert(!socket._httpMessage);

Expand Down

0 comments on commit 5b02d56

Please sign in to comment.