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

Commit

Permalink
net: destroy socket on DNS error
Browse files Browse the repository at this point in the history
The socket was never destroyed on DNS errors. This broke some clients, including
lib/https.js.
  • Loading branch information
SaltwaterC authored and bnoordhuis committed Feb 3, 2012
1 parent 68db206 commit 4671e54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/net.js
Expand Up @@ -570,6 +570,7 @@ Socket.prototype.connect = function(port /* [host], [cb] */) {
// error event to the next tick.
process.nextTick(function() {
self.emit('error', err);
self.destroy();
});
} else {
timers.active(self);
Expand Down

0 comments on commit 4671e54

Please sign in to comment.