mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-431: Fix tunnel stuck in CLOSED state
When the tunnel is closed and another `connect()` call is made, it stops notifying about state changes (`onstatechanges`) if the connection continues to fail. This patch sets the state to `CONNECTING` when calling `connect()`.
This commit is contained in:
@@ -564,6 +564,9 @@ Guacamole.HTTPTunnel = function(tunnelURL, crossDomain) {
|
||||
// Start waiting for connect
|
||||
reset_timeout();
|
||||
|
||||
// Mark the tunnel as connecting
|
||||
tunnel.setState(Guacamole.Tunnel.State.CONNECTING);
|
||||
|
||||
// Start tunnel and connect
|
||||
var connect_xmlhttprequest = new XMLHttpRequest();
|
||||
connect_xmlhttprequest.onreadystatechange = function() {
|
||||
@@ -760,6 +763,9 @@ Guacamole.WebSocketTunnel = function(tunnelURL) {
|
||||
|
||||
reset_timeout();
|
||||
|
||||
// Mark the tunnel as connecting
|
||||
tunnel.setState(Guacamole.Tunnel.State.CONNECTING);
|
||||
|
||||
// Connect socket
|
||||
socket = new WebSocket(tunnelURL + "?" + data, "guacamole");
|
||||
|
||||
|
Reference in New Issue
Block a user