* Fix file transfer bug for WebSockets and SSH. Set/restore temp data handler belongs in base client.

* Lint some files
This commit is contained in:
Bryan Ashby 2018-05-12 09:33:41 -06:00
parent b2ae81c59e
commit 388e581b90
4 changed files with 57 additions and 53 deletions

View file

@ -30,6 +30,10 @@ function WebSocketClient(ws, req, serverType) {
const self = this;
this.dataHandler = function(data) {
self.socketBridge.emit('data', data);
};
//
// This bridge makes accessible various calls that client sub classes
// want to access on I/O socket
@ -65,9 +69,7 @@ function WebSocketClient(ws, req, serverType) {
}
}(ws);
ws.on('message', data => {
this.socketBridge.emit('data', data);
});
ws.on('message', this.dataHandler);
ws.on('close', () => {
// we'll remove client connection which will in turn end() via our SocketBridge above