Idle timeout kicks user when on a telnet bridge downloading files #262
This commit is contained in:
parent
c3a19eb208
commit
33a1d1b812
|
@ -51,14 +51,22 @@ class TelnetClientConnection extends EventEmitter {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|
||||||
|
this.dataHits = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateActivity() {
|
||||||
|
if (0 === (this.dataHits++ % 4)) {
|
||||||
|
this.client.explicitActivityTimeUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
restorePipe() {
|
restorePipe() {
|
||||||
if(!this.pipeRestored) {
|
if(!this.pipeRestored) {
|
||||||
this.pipeRestored = true;
|
this.pipeRestored = true;
|
||||||
this.client.dataPassthrough = false;
|
|
||||||
|
this.client.restoreDataHandler();
|
||||||
|
|
||||||
// client may have bailed
|
// client may have bailed
|
||||||
if(null !== _.get(this, 'client.term.output', null)) {
|
if(null !== _.get(this, 'client.term.output', null)) {
|
||||||
|
@ -75,11 +83,15 @@ class TelnetClientConnection extends EventEmitter {
|
||||||
this.emit('connected');
|
this.emit('connected');
|
||||||
|
|
||||||
this.pipeRestored = false;
|
this.pipeRestored = false;
|
||||||
this.client.dataPassthrough = true;
|
this.client.setTemporaryDirectDataHandler(data => {
|
||||||
this.client.term.output.pipe(this.bridgeConnection);
|
this.updateActivity();
|
||||||
|
this.bridgeConnection.write(data);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.bridgeConnection.on('data', data => {
|
this.bridgeConnection.on('data', data => {
|
||||||
|
this.updateActivity();
|
||||||
|
|
||||||
this.client.term.rawWrite(data);
|
this.client.term.rawWrite(data);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue