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/Congestion.h b/common/rfb/Congestion.h
index fd57c22..d293512 100644
--- a/common/rfb/Congestion.h
+++ b/common/rfb/Congestion.h
@@ -1,4 +1,4 @@
-/* Copyright 2009-2015 Pierre Ossman for Cendio AB
+/* Copyright 2009-2018 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,6 +47,10 @@
// longer be congested.
int getUncongestedETA();
+ // getBandwidth() returns the current bandwidth estimation in bytes
+ // per second.
+ size_t getBandwidth();
+
// debugTrace() writes the current congestion window, as well as the
// congestion window of the underlying TCP layer, to the specified
// file
@@ -68,6 +72,8 @@
unsigned congWindow;
bool inSlowStart;
+ unsigned safeBaseRTT;
+
struct RTTInfo {
struct timeval tv;
unsigned pos;