From c555fe64112ff6b4212eed7582e367cb204803b4 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 25 Mar 2022 21:37:17 +0000 Subject: [PATCH 1/2] GUACAMOLE-1562: Ensure "ping" response is not erroneously handled as the tunnel UUID. --- guacamole-common-js/src/main/webapp/modules/Tunnel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Tunnel.js b/guacamole-common-js/src/main/webapp/modules/Tunnel.js index 23657cddc..f300821e8 100644 --- a/guacamole-common-js/src/main/webapp/modules/Tunnel.js +++ b/guacamole-common-js/src/main/webapp/modules/Tunnel.js @@ -1094,7 +1094,7 @@ Guacamole.WebSocketTunnel = function(tunnelURL) { if (tunnel.uuid === null) { // Associate tunnel UUID if received - if (opcode === Guacamole.Tunnel.INTERNAL_DATA_OPCODE) + if (opcode === Guacamole.Tunnel.INTERNAL_DATA_OPCODE && elements.length === 1) tunnel.setUUID(elements[0]); // Tunnel is now open and UUID is available From b9e79d99c5121cc8b358c71faf810492874ad2d8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 25 Mar 2022 21:37:53 +0000 Subject: [PATCH 2/2] GUACAMOLE-1562: Update chained tunnel UUID when underlying tunnel receives UUID. --- guacamole-common-js/src/main/webapp/modules/Tunnel.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Tunnel.js b/guacamole-common-js/src/main/webapp/modules/Tunnel.js index f300821e8..fa886f561 100644 --- a/guacamole-common-js/src/main/webapp/modules/Tunnel.js +++ b/guacamole-common-js/src/main/webapp/modules/Tunnel.js @@ -1236,12 +1236,17 @@ Guacamole.ChainedTunnel = function(tunnelChain) { tunnel.onstatechange = chained_tunnel.onstatechange; tunnel.oninstruction = chained_tunnel.oninstruction; tunnel.onerror = chained_tunnel.onerror; - tunnel.onuuid = chained_tunnel.onuuid; // Assign UUID if already known if (tunnel.uuid) chained_tunnel.setUUID(tunnel.uuid); + // Assign any future received UUIDs such that they are + // accessible from the main uuid property of the chained tunnel + tunnel.onuuid = function uuidReceived(uuid) { + chained_tunnel.setUUID(uuid); + }; + committedTunnel = tunnel; }