From 2cff92ff1f7ef8b6ef5c27189df463a347165164 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 9 Mar 2012 16:00:23 -0800 Subject: [PATCH] Only chain to next tunnel if no instructions received. Pass through errors otherwise. --- guacamole-common-js/src/main/resources/tunnel.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guacamole-common-js/src/main/resources/tunnel.js b/guacamole-common-js/src/main/resources/tunnel.js index 835f9f56f..3a0a481c4 100644 --- a/guacamole-common-js/src/main/resources/tunnel.js +++ b/guacamole-common-js/src/main/resources/tunnel.js @@ -674,7 +674,16 @@ Guacamole.ChainedTunnel = function() { // Wrap own oninstruction within current tunnel current_tunnel.oninstruction = function(opcode, elements) { + + // Invoke handler chained_tunnel.oninstruction(opcode, elements); + + // Use handler permanently from now on + current_tunnel.oninstruction = chained_tunnel.oninstruction; + + // Pass through errors (without trying other tunnels) + current_tunnel.onerror = chained_tunnel.onerror; + } // Attach next tunnel on error