Limit lossless refresh update to safe size
We don't want to waste bandwidth on the lossless refresh if we might
need that bandwidth for a normal update. Try to estimate how much
data we can safely send without interfering.
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 83f2b7e..15df71b 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -593,6 +593,17 @@
frameTimer.stop();
}
+int VNCServerST::msToNextUpdate()
+{
+ // FIXME: If the application is updating slower than frameRate then
+ // we could allow the clients more time here
+
+ if (!frameTimer.isStarted())
+ return 1000/rfb::Server::frameRate/2;
+ else
+ return frameTimer.getRemainingMs();
+}
+
// writeUpdate() is called on a regular interval in order to see what
// updates are pending and propagates them to the update tracker for
// each client. It uses the ComparingUpdateTracker's compare() method