net: destroy socket on DNS error

The socket was never destroyed on DNS errors. This broke some clients, including
lib/https.js.
This commit is contained in:
Stefan Rusu 2012-02-03 18:27:53 +02:00 committed by Ben Noordhuis
parent 68db20656e
commit 4671e54495

View File

@ -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);