diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-05-07 11:55:12 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-05-15 22:53:29 +0200 |
commit | b3d1e504f4a3a4c44be3ca53b2aa44282fc391df (patch) | |
tree | 006e375d57ec8739a377a0ecf7c96c8efb5cef99 /lib | |
parent | 6902f6536cee48904a1779b6e196b14b5f86d526 (diff) | |
download | node-new-b3d1e504f4a3a4c44be3ca53b2aa44282fc391df.tar.gz |
net: emit dns 'lookup' event before connect
net.connect() and net.createConnection() now emit a 'lookup' event
after resolving the hostname but before connecting.
Fixes #5418.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/net.js b/lib/net.js index 4affa8d754..a86ca85d12 100644 --- a/lib/net.js +++ b/lib/net.js @@ -860,6 +860,8 @@ Socket.prototype.connect = function(options, cb) { var host = options.host; debug('connect: find host ' + host); require('dns').lookup(host, function(err, ip, addressType) { + self.emit('lookup', err, ip, addressType); + // It's possible we were destroyed while looking this up. // XXX it would be great if we could cancel the promise returned by // the look up. |