@@ -41,7 +41,9 @@ extern "C"
4141#include <stdio.h>
4242#include <stdlib.h>
4343#include <string.h>
44+ #include <rfb/rfblist.h>
4445#include <rfb/rfbproto.h>
46+ #include <rfb/rfbtimers.h>
4547
4648#if defined(ANDROID ) || defined(LIBVNCSERVER_HAVE_ANDROID )
4749#include <arpa/inet.h>
@@ -372,9 +374,18 @@ typedef struct _rfbScreenInfo
372374#ifdef LIBVNCSERVER_HAVE_LIBZ
373375 rfbSetXCutTextUTF8ProcPtr setXCutTextUTF8 ;
374376#endif
377+ rfbBool rfbCongestionControl ;
375378} rfbScreenInfo , * rfbScreenInfoPtr ;
376379
377380
381+ typedef struct {
382+ struct timeval tv ;
383+ unsigned pos , extra ;
384+ char congested ;
385+ struct rfb_list entry ;
386+ } rfbRTTInfo ;
387+
388+
378389/**
379390 * rfbTranslateFnType is the type of translation functions.
380391 */
@@ -707,6 +718,34 @@ typedef struct _rfbClientRec {
707718 int tightPngDstDataLen ;
708719#endif
709720#endif
721+
722+ /* flow control extensions */
723+
724+ rfbBool enableCU ; /**< client supports Continuous Updates */
725+ rfbBool enableFence ; /**< client supports fence extension */
726+
727+ rfbBool continuousUpdates ;
728+ sraRegionPtr cuRegion ;
729+
730+ rfbTimersPtr timers ;
731+
732+ rfbBool pendingSyncFence , syncFence ;
733+ uint32_t fenceFlags ;
734+ unsigned fenceDataLen ;
735+ char fenceData [64 ];
736+
737+ unsigned lastPosition , extraBuffer ;
738+ struct timeval lastUpdate , lastSent ;
739+ unsigned baseRTT , congWindow ;
740+ rfbBool inSlowStart ;
741+ int sockOffset ;
742+ struct rfb_list pings ;
743+ rfbTimerPtr congestionTimer ;
744+ rfbRTTInfo lastPong ;
745+ struct timeval lastPongArrival ;
746+ int measurements ;
747+ struct timeval lastAdjustment ;
748+ unsigned minRTT , minCongestedRTT ;
710749} rfbClientRec , * rfbClientPtr ;
711750
712751/**
@@ -755,9 +794,12 @@ extern int rfbMaxClientWait;
755794
756795extern void rfbInitSockets (rfbScreenInfoPtr rfbScreen );
757796extern void rfbShutdownSockets (rfbScreenInfoPtr rfbScreen );
797+ extern void rfbCorkSock (int sock );
798+ extern void rfbUncorkSock (int sock );
758799extern void rfbDisconnectUDPSock (rfbScreenInfoPtr rfbScreen );
759800extern void rfbCloseClient (rfbClientPtr cl );
760801extern int rfbReadExact (rfbClientPtr cl , char * buf , int len );
802+ extern int rfbSkipExact (rfbClientPtr cl , int len );
761803extern int rfbReadExactTimeout (rfbClientPtr cl , char * buf , int len ,int timeout );
762804extern int rfbPeekExactTimeout (rfbClientPtr cl , char * buf , int len ,int timeout );
763805extern int rfbWriteExact (rfbClientPtr cl , const char * buf , int len );
0 commit comments