telnet-client
Advanced tools
Comparing version 0.13.2 to 0.13.3
@@ -124,3 +124,17 @@ 'use strict' | ||
this.once('responseready', () => { | ||
this.once('responseready', responseHandler) | ||
this.once('bufferexceeded', buffExcHandler) | ||
if (this.execTimeout) { | ||
execTimeout = setTimeout(() => { | ||
execTimeout = null | ||
this.removeListener('responseready', responseHandler) | ||
this.removeListener('bufferexceeded', buffExcHandler) | ||
if (!this.response) return reject(new Error('response not received')) | ||
}, this.execTimeout) | ||
} | ||
function responseHandler() { | ||
if (execTimeout !== null) { | ||
@@ -140,5 +154,7 @@ clearTimeout(execTimeout) | ||
this.state = 'standby' | ||
}) | ||
this.once('bufferexceeded', () => { | ||
this.removeListener('bufferexceeded', buffExcHandler) | ||
} | ||
function buffExcHandler() { | ||
if (execTimeout !== null) { | ||
@@ -157,10 +173,2 @@ clearTimeout(execTimeout) | ||
this.state = 'standby' | ||
}) | ||
if (this.execTimeout) { | ||
execTimeout = setTimeout(() => { | ||
execTimeout = null | ||
if (!this.response) return reject(new Error('response not received')) | ||
}, this.execTimeout) | ||
} | ||
@@ -167,0 +175,0 @@ }) |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.13.2", | ||
"version": "0.13.3", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 6.9.1", |
Sorry, the diff of this file is not supported yet
36681
15
747