Comparing version 6.8.3 to 6.8.4
CHANGELOG | ||
========= | ||
## 6.8.4 (2019-12-18) | ||
* @bdeitte Fix cacheDns with udp | ||
## 6.8.3 (2019-12-15) | ||
@@ -5,0 +8,0 @@ * @gleb-rudenko Fix StatsD constructor typing |
@@ -19,3 +19,2 @@ const util = require('util'), | ||
let options = host || {}; | ||
const self = this; | ||
@@ -81,28 +80,35 @@ // Adding options below is DEPRECATED. Use the options object instead. | ||
} | ||
this.socket = options.socket; | ||
} else if (options.cacheDns === true) { | ||
dns.lookup(this.host, (err, address) => { | ||
if (err === null) { | ||
self.host = address; | ||
this.host = address; | ||
} else { | ||
self.dnsError = err; | ||
this.dnsError = err; | ||
} | ||
this.socket = createTransport(this, { | ||
host: this.host, | ||
path: options.path, | ||
port: this.port, | ||
protocol: this.protocol, | ||
stream: options.stream | ||
}); | ||
}); | ||
} | ||
if (options.useDefaultRoute) { | ||
const defaultRoute = helpers.getDefaultRoute(); | ||
if (defaultRoute) { | ||
console.log(`Got ${defaultRoute} for the system's default route`); | ||
this.host = defaultRoute; | ||
} else { | ||
if (options.useDefaultRoute) { | ||
const defaultRoute = helpers.getDefaultRoute(); | ||
if (defaultRoute) { | ||
console.log(`Got ${defaultRoute} for the system's default route`); | ||
this.host = defaultRoute; | ||
} | ||
} | ||
this.socket = createTransport(this, { | ||
host: this.host, | ||
path: options.path, | ||
port: this.port, | ||
protocol: this.protocol, | ||
stream: options.stream | ||
}); | ||
} | ||
this.socket = options.isChild ? options.socket : createTransport(this, { | ||
host: this.host, | ||
path: options.path, | ||
port: this.port, | ||
protocol: this.protocol, | ||
stream: options.stream | ||
}); | ||
if (!options.isChild && options.errorHandler) { | ||
@@ -109,0 +115,0 @@ this.socket.on('error', options.errorHandler); |
{ | ||
"name": "hot-shots", | ||
"description": "Node.js client for StatsD, DogStatsD, and Telegraf", | ||
"version": "6.8.3", | ||
"version": "6.8.4", | ||
"author": "Steve Ivy", | ||
@@ -6,0 +6,0 @@ "types": "./types.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73066
1398