Don't try to push out another update if the socket is already full. This
avoids stalling the entire server because of one slow client.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4737 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h
index c9e4ac8..abf4383 100644
--- a/common/rfb/VNCSConnectionST.h
+++ b/common/rfb/VNCSConnectionST.h
@@ -32,10 +32,12 @@
 #include <rfb/SMsgWriter.h>
 #include <rfb/TransImageGetter.h>
 #include <rfb/VNCServerST.h>
+#include <rfb/Timer.h>
 
 namespace rfb {
   class VNCSConnectionST : public SConnection,
-                           public WriteSetCursorCallback {
+                           public WriteSetCursorCallback,
+                           public Timer::Callback {
   public:
     VNCSConnectionST(VNCServerST* server_, network::Socket* s, bool reverse);
     virtual ~VNCSConnectionST();
@@ -140,8 +142,13 @@
     // WriteSetCursorCallback
     virtual void writeSetCursorCallback();
 
+    // Timer callbacks
+    virtual bool handleTimeout(Timer* t);
+
     // Internal methods
 
+    bool isCongested();
+
     // writeFramebufferUpdate() attempts to write a framebuffer update to the
     // client.
 
@@ -161,6 +168,8 @@
     bool drawRenderedCursor, removeRenderedCursor;
     Rect renderedCursorRect;
 
+    Timer updateTimer;
+
     std::set<rdr::U32> pressedKeys;
 
     time_t lastEventTime;