From b5bd316dfdd2a87d470a97871f679e38bedc6659 Mon Sep 17 00:00:00 2001 From: Tyler Schneider Date: Thu, 2 Mar 2017 11:01:53 -0700 Subject: [PATCH] GUACAMOLE-229: Remove intervals properly when XHR is polling. --- guacamole-common-js/src/main/webapp/modules/Tunnel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Tunnel.js b/guacamole-common-js/src/main/webapp/modules/Tunnel.js index 6ec479821..44013e846 100644 --- a/guacamole-common-js/src/main/webapp/modules/Tunnel.js +++ b/guacamole-common-js/src/main/webapp/modules/Tunnel.js @@ -393,7 +393,7 @@ Guacamole.HTTPTunnel = function(tunnelURL, crossDomain) { if (pollingMode === POLLING_ENABLED) { if (xmlhttprequest.readyState === 3 && !interval) interval = setInterval(parseResponse, 30); - else if (xmlhttprequest.readyState === 4 && !interval) + else if (xmlhttprequest.readyState === 4 && interval) clearInterval(interval); } @@ -461,7 +461,7 @@ Guacamole.HTTPTunnel = function(tunnelURL, crossDomain) { if (length === 0) { // Clean up interval if polling - if (!interval) + if (interval) clearInterval(interval); // Clean up object