Update passthrough state

This commit is contained in:
Bryan Ashby 2020-05-20 20:24:12 -06:00
parent 65d68f33dc
commit 72301104ff
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 2 additions and 0 deletions

View File

@ -107,11 +107,13 @@ function Client(/*input, output*/) {
});
this.setTemporaryDirectDataHandler = function(handler) {
this.dataPassthrough = true; // let implementations do with what they will here
this.input.removeAllListeners('data');
this.input.on('data', handler);
};
this.restoreDataHandler = function() {
this.dataPassthrough = false;
this.input.removeAllListeners('data');
this.input.on('data', this.dataHandler);
};