Added workaround for bug where a connection reset causes an uncaught exception

This commit is contained in:
Bryan Roe 2021-10-17 22:13:13 -07:00
parent 6b4efaabbe
commit 3acad0b3d6

View File

@ -1794,21 +1794,27 @@ function onTunnelClosed() {
} }
} }
// Sent tunnel statistics to the server, only send this if compression was used. try
if ((this.bytesSent_uncompressed) && (this.bytesSent_uncompressed.toString() != this.bytesSent_actual.toString())) { {
mesh.SendCommand({ // Sent tunnel statistics to the server, only send this if compression was used.
action: 'tunnelCloseStats', if ((this.bytesSent_uncompressed) && (this.bytesSent_uncompressed.toString() != this.bytesSent_actual.toString())) {
url: tunnel.url, mesh.SendCommand({
userid: tunnel.userid, action: 'tunnelCloseStats',
protocol: tunnel.protocol, url: tunnel.url,
sessionid: tunnel.sessionid, userid: tunnel.userid,
sent: this.bytesSent_uncompressed.toString(), protocol: tunnel.protocol,
sentActual: this.bytesSent_actual.toString(), sessionid: tunnel.sessionid,
sentRatio: this.bytesSent_ratio, sent: this.bytesSent_uncompressed.toString(),
received: this.bytesReceived_uncompressed.toString(), sentActual: this.bytesSent_actual.toString(),
receivedActual: this.bytesReceived_actual.toString(), sentRatio: this.bytesSent_ratio,
receivedRatio: this.bytesReceived_ratio received: this.bytesReceived_uncompressed.toString(),
}); receivedActual: this.bytesReceived_actual.toString(),
receivedRatio: this.bytesReceived_ratio
});
}
}
catch(z)
{
} }
//sendConsoleText("Tunnel #" + this.httprequest.index + " closed. Sent -> " + this.bytesSent_uncompressed + ' bytes (uncompressed), ' + this.bytesSent_actual + ' bytes (actual), ' + this.bytesSent_ratio + '% compression', this.httprequest.sessionid); //sendConsoleText("Tunnel #" + this.httprequest.index + " closed. Sent -> " + this.bytesSent_uncompressed + ' bytes (uncompressed), ' + this.bytesSent_actual + ' bytes (actual), ' + this.bytesSent_ratio + '% compression', this.httprequest.sessionid);