limitd-client
Advanced tools
Comparing version 2.1.5 to 2.2.0
@@ -51,4 +51,8 @@ const url = require('url'); | ||
if (typeof host === 'string') { | ||
host = _.pick(url.parse(host), ['port', 'hostname']); | ||
host.port = typeof host.port !== 'undefined' ? parseInt(host.port, 10) : undefined; | ||
if (host.match(/\.socket$/)) { | ||
host = { port: host }; | ||
} else { | ||
host = _.pick(url.parse(host), ['port', 'hostname']); | ||
host.port = typeof host.port !== 'undefined' ? parseInt(host.port, 10) : undefined; | ||
} | ||
} | ||
@@ -117,2 +121,3 @@ return host; | ||
connection.setKeepAlive(true, 50); | ||
connection.setNoDelay(); | ||
setImmediate(() => { | ||
@@ -160,9 +165,3 @@ this.emit('connect'); | ||
transform(chunk, enc, callback) { | ||
try { | ||
const decoded = Protocol.Response.decode(chunk); | ||
this.push(decoded); | ||
} catch(err) { | ||
return callback(err); | ||
} | ||
callback(); | ||
callback(null, Protocol.Response.decode(chunk)); | ||
} | ||
@@ -169,0 +168,0 @@ })) |
{ | ||
"name": "limitd-client", | ||
"version": "2.1.5", | ||
"version": "2.2.0", | ||
"description": "limitd client for node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
34415
863