telnet-client
Advanced tools
Comparing version 0.12.2 to 0.12.3
@@ -178,3 +178,20 @@ // Node.js Telnet client | ||
this.on('data', data => { | ||
this.on('data', sendHandler) | ||
if ((opts && opts.waitfor === undefined) || !opts) { | ||
setTimeout(() => { | ||
if (response === '') { | ||
this.removeListener('data', sendHandler) | ||
reject(new Error('response not received')) | ||
return | ||
} | ||
this.removeListener('data', sendHandler) | ||
resolve(response) | ||
}, this.sendTimeout) | ||
} | ||
const self = this | ||
function sendHandler(data) { | ||
response += data.toString() | ||
@@ -185,15 +202,9 @@ | ||
self.removeListener('data', sendHandler) | ||
resolve(response) | ||
} | ||
}) | ||
if ((opts && opts.waitfor === undefined) || !opts) { | ||
setTimeout(() => { | ||
if (response === '') return reject(new Error('response not received')) | ||
resolve(response) | ||
}, this.sendTimeout) | ||
} | ||
}) | ||
} | ||
}).asCallback(callback) | ||
@@ -200,0 +211,0 @@ } |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.12.2", | ||
"version": "0.12.3", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 6.9.1", |
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
135181
16
1110