Skip to content

Commit cf1f006

Browse files
committed
Close proxysock on error and cleanup status on disconnect
1 parent 70d0892 commit cf1f006

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

meshcentral-server-0.2.0.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var CreateMeshCentralServer = function (host, port, path, username, password, to
134134
}
135135
} else {
136136
console.log("Proxy connection failed: "+ e.toString());
137-
obj.socket.end();
137+
obj.proxysocket.end();
138138
}
139139
return;
140140
}
@@ -299,6 +299,7 @@ var CreateMeshCentralServer = function (host, port, path, username, password, to
299299
obj.meshes = {};
300300
obj.userinfo = null;
301301
obj.computerlist = [];
302+
obj.proxy_connected = false;
302303
//console.log('closed');
303304
}
304305

websocket-wrapper-0.2.0.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ var CreateWebSocketWrapper = function (host, port, path, certhash, http_proxy) {
138138
}
139139
} else {
140140
console.log("Proxy connection failed: "+ e.toString());
141-
obj.socket.end();
141+
obj.proxysocket.end();
142142
}
143143
return;
144144
}
@@ -219,6 +219,7 @@ var CreateWebSocketWrapper = function (host, port, path, certhash, http_proxy) {
219219
obj.socketState = 0;
220220
if (obj.onclose != null) { obj.onclose(); }
221221
if (obj.socket != null) { try { obj.socket.end(); } catch (ex) { } obj.socket = null; }
222+
obj.proxy_connected = false;
222223
}
223224

224225
// Called to send websocket data to the server

0 commit comments

Comments
 (0)