mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-03 01:45:59 -05:00
Fix for #2855. TCP/UDP exception on close.
This commit is contained in:
parent
2727c28426
commit
119bf305ae
@ -871,7 +871,7 @@ function handleServerCommand(data) {
|
|||||||
woptions.checkServerIdentity.servertlshash = data.servertlshash;
|
woptions.checkServerIdentity.servertlshash = data.servertlshash;
|
||||||
|
|
||||||
//sendConsoleText(JSON.stringify(woptions));
|
//sendConsoleText(JSON.stringify(woptions));
|
||||||
sendConsoleText('TUNNEL: ' + JSON.stringify(data));
|
//sendConsoleText('TUNNEL: ' + JSON.stringify(data));
|
||||||
var tunnel = http.request(woptions);
|
var tunnel = http.request(woptions);
|
||||||
tunnel.upgrade = onTunnelUpgrade;
|
tunnel.upgrade = onTunnelUpgrade;
|
||||||
tunnel.on('error', function (e) { sendConsoleText("ERROR: Unable to connect relay tunnel to: " + this.url + ", " + JSON.stringify(e)); });
|
tunnel.on('error', function (e) { sendConsoleText("ERROR: Unable to connect relay tunnel to: " + this.url + ", " + JSON.stringify(e)); });
|
||||||
@ -1648,12 +1648,12 @@ function onTunnelClosed() {
|
|||||||
// If this is a routing session, clean up and send the new session counts.
|
// If this is a routing session, clean up and send the new session counts.
|
||||||
if (this.httprequest.userid != null) {
|
if (this.httprequest.userid != null) {
|
||||||
if (this.httprequest.tcpport != null) {
|
if (this.httprequest.tcpport != null) {
|
||||||
var userid = getUserIdAndGuestNameFromHttpRequest(s.httprequest);
|
var userid = getUserIdAndGuestNameFromHttpRequest(this.httprequest);
|
||||||
if (tunnelUserCount.tcp[userid] != null) { tunnelUserCount.tcp[userid]--; if (tunnelUserCount.tcp[userid] <= 0) { delete tunnelUserCount.tcp[userid]; } }
|
if (tunnelUserCount.tcp[userid] != null) { tunnelUserCount.tcp[userid]--; if (tunnelUserCount.tcp[userid] <= 0) { delete tunnelUserCount.tcp[userid]; } }
|
||||||
try { mesh.SendCommand({ action: 'sessions', type: 'tcp', value: tunnelUserCount.tcp }); } catch (e) { }
|
try { mesh.SendCommand({ action: 'sessions', type: 'tcp', value: tunnelUserCount.tcp }); } catch (e) { }
|
||||||
broadcastSessionsToRegisteredApps();
|
broadcastSessionsToRegisteredApps();
|
||||||
} else if (this.httprequest.udpport != null) {
|
} else if (this.httprequest.udpport != null) {
|
||||||
var userid = getUserIdAndGuestNameFromHttpRequest(s.httprequest);
|
var userid = getUserIdAndGuestNameFromHttpRequest(this.httprequest);
|
||||||
if (tunnelUserCount.udp[userid] != null) { tunnelUserCount.udp[userid]--; if (tunnelUserCount.udp[userid] <= 0) { delete tunnelUserCount.udp[userid]; } }
|
if (tunnelUserCount.udp[userid] != null) { tunnelUserCount.udp[userid]--; if (tunnelUserCount.udp[userid] <= 0) { delete tunnelUserCount.udp[userid]; } }
|
||||||
try { mesh.SendCommand({ action: 'sessions', type: 'udp', value: tunnelUserCount.udp }); } catch (e) { }
|
try { mesh.SendCommand({ action: 'sessions', type: 'udp', value: tunnelUserCount.udp }); } catch (e) { }
|
||||||
broadcastSessionsToRegisteredApps();
|
broadcastSessionsToRegisteredApps();
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
"node-windows": "^1.0.0-beta.5",
|
"node-windows": "^1.0.0-beta.5",
|
||||||
"nodemailer": "^6.6.2",
|
"nodemailer": "^6.6.2",
|
||||||
"otplib": "^10.2.3",
|
"otplib": "^10.2.3",
|
||||||
|
"saslprep": "^1.0.3",
|
||||||
"ssh2": "^1.1.0",
|
"ssh2": "^1.1.0",
|
||||||
"web-push": "^3.4.5",
|
"web-push": "^3.4.5",
|
||||||
"ws": "^5.2.0",
|
"ws": "^5.2.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user