Only send sync response if timestamp is changing.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 9 Jan 2012 07:47:07 +0000 (23:47 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 9 Jan 2012 07:47:07 +0000 (23:47 -0800)
src/main/resources/guacamole.js

index 535f9b2..0a1b72c 100644 (file)
@@ -404,8 +404,10 @@ Guacamole.Client = function(display, tunnel) {
 
                 // Send sync response when layers are finished
                 if (layersToSync == 0) {
-                    tunnel.sendMessage("sync", timestamp);
-                    currentTimestamp = timestamp;
+                    if (timestamp != currentTimestamp) {
+                        tunnel.sendMessage("sync", timestamp);
+                        currentTimestamp = timestamp;
+                    }
                 }
 
             }
@@ -424,8 +426,10 @@ Guacamole.Client = function(display, tunnel) {
             // If all layers are ready, then we didn't install any hooks.
             // Send sync message now,
             if (layersToSync == 0) {
-                tunnel.sendMessage("sync", timestamp);
-                currentTimestamp = timestamp;
+                if (timestamp != currentTimestamp) {
+                    tunnel.sendMessage("sync", timestamp);
+                    currentTimestamp = timestamp;
+                }
             }
 
         }