From df3347f63110c14ce7394352cc144911f862a694 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 1 May 2016 23:51:18 -0700 Subject: [PATCH] GUACAMOLE-25: Automatically invalidate output stream due to "ack" ONLY if it's the same stream that received the "ack". It is possible for the output stream to be freed and replaced with a different stream within onack. --- guacamole-common-js/src/main/webapp/modules/Client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index 8903f2193..060f46026 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -648,8 +648,9 @@ Guacamole.Client = function(tunnel) { if (stream.onack) stream.onack(new Guacamole.Status(code, reason)); - // If code is an error, invalidate stream - if (code >= 0x0100) { + // If code is an error, invalidate stream if not already + // invalidated by onack handler + if (code >= 0x0100 && output_streams[stream_index] === stream) { stream_indices.free(stream_index); delete output_streams[stream_index]; }