| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a2ad216 commit b07bc5d
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -317,6 +317,7 @@ Not applicable to UNIX sockets. | |||
| 317 | 317 | * `err` {Error|Null} The error object. See [`dns.lookup()`][]. | |
| 318 | 318 | * `address` {String} The IP address. | |
| 319 | 319 | * `family` {String|Null} The address type. See [`dns.lookup()`][]. | |
| 320 | + * `host` {String} The hostname. | ||
| 320 | 321 | ||
| 321 | 322 | ### Event: 'timeout' | |
| 322 | 323 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -963,7 +963,7 @@ function lookupAndConnect(self, options) { | |||
| 963 | 963 | self._host = host; | |
| 964 | 964 | var lookup = options.lookup || dns.lookup; | |
| 965 | 965 | lookup(host, dnsopts, function(err, ip, addressType) { | |
| 966 | - self.emit('lookup', err, ip, addressType); | ||
| 966 | + self.emit('lookup', err, ip, addressType, host); | ||
| 967 | 967 | ||
| 968 | 968 | // It's possible we were destroyed while looking this up. | |
| 969 | 969 | // XXX it would be great if we could cancel the promise returned by | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,12 +10,14 @@ var server = net.createServer(function(client) { | |||
| 10 | 10 | }); | |
| 11 | 11 | ||
| 12 | 12 | server.listen(common.PORT, '127.0.0.1', function() { | |
| 13 | - net.connect(common.PORT, 'localhost').on('lookup', function(err, ip, type) { | ||
| 14 | - assert.equal(err, null); | ||
| 15 | - assert.equal(ip, '127.0.0.1'); | ||
| 16 | - assert.equal(type, '4'); | ||
| 17 | - ok = true; | ||
| 18 | - }); | ||
| 13 | + net.connect(common.PORT, 'localhost') | ||
| 14 | + .on('lookup', function(err, ip, type, host) { | ||
| 15 | + assert.equal(err, null); | ||
| 16 | + assert.equal(ip, '127.0.0.1'); | ||
| 17 | + assert.equal(type, '4'); | ||
| 18 | + assert.equal(host, 'localhost'); | ||
| 19 | + ok = true; | ||
| 20 | + }); | ||
| 19 | 21 | }); | |
| 20 | 22 | ||
| 21 | 23 | process.on('exit', function() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments