Skip to content

Commit

Permalink
libvncserver: continuous updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Samokhatko committed Feb 15, 2023
1 parent eb5f435 commit 0c3aa75
Show file tree
Hide file tree
Showing 12 changed files with 1,986 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ set(LIBVNCSERVER_SOURCES
${LIBVNCSERVER_DIR}/ultra.c
${LIBVNCSERVER_DIR}/scale.c
${CRYPTO_SOURCES}
${LIBVNCSERVER_DIR}/flowcontrol.c
${LIBVNCSERVER_DIR}/rfbtimers.c
)

set(LIBVNCCLIENT_SOURCES
Expand Down Expand Up @@ -782,9 +784,11 @@ if(LIBVNCSERVER_INSTALL)
include/rfb/threading.h
include/rfb/rfb.h
include/rfb/rfbclient.h
include/rfb/rfblist.h
${CMAKE_CURRENT_BINARY_DIR}/include/rfb/rfbconfig.h
include/rfb/rfbproto.h
include/rfb/rfbregion.h
include/rfb/rfbtimers.h
)

set_property(TARGET vncclient PROPERTY PUBLIC_HEADER ${INSTALL_HEADER_FILES})
Expand Down
42 changes: 42 additions & 0 deletions include/rfb/rfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ extern "C"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rfb/rfblist.h>
#include <rfb/rfbproto.h>
#include <rfb/rfbtimers.h>

#if defined(ANDROID) || defined(LIBVNCSERVER_HAVE_ANDROID)
#include <arpa/inet.h>
Expand Down Expand Up @@ -372,9 +374,18 @@ typedef struct _rfbScreenInfo
#ifdef LIBVNCSERVER_HAVE_LIBZ
rfbSetXCutTextUTF8ProcPtr setXCutTextUTF8;
#endif
rfbBool rfbCongestionControl;
} rfbScreenInfo, *rfbScreenInfoPtr;


typedef struct {
struct timeval tv;
unsigned pos, extra;
char congested;
struct rfb_list entry;
} rfbRTTInfo;


/**
* rfbTranslateFnType is the type of translation functions.
*/
Expand Down Expand Up @@ -707,6 +718,34 @@ typedef struct _rfbClientRec {
int tightPngDstDataLen;
#endif
#endif

/* flow control extensions */

rfbBool enableCU; /**< client supports Continuous Updates */
rfbBool enableFence; /**< client supports fence extension */

rfbBool continuousUpdates;
sraRegionPtr cuRegion;

rfbTimersPtr timers;

rfbBool pendingSyncFence, syncFence;
uint32_t fenceFlags;
unsigned fenceDataLen;
char fenceData[64];

unsigned lastPosition, extraBuffer;
struct timeval lastUpdate, lastSent;
unsigned baseRTT, congWindow;
rfbBool inSlowStart;
int sockOffset;
struct rfb_list pings;
rfbTimerPtr congestionTimer;
rfbRTTInfo lastPong;
struct timeval lastPongArrival;
int measurements;
struct timeval lastAdjustment;
unsigned minRTT, minCongestedRTT;
} rfbClientRec, *rfbClientPtr;

/**
Expand Down Expand Up @@ -755,9 +794,12 @@ extern int rfbMaxClientWait;

extern void rfbInitSockets(rfbScreenInfoPtr rfbScreen);
extern void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen);
extern void rfbCorkSock(int sock);
extern void rfbUncorkSock(int sock);
extern void rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen);
extern void rfbCloseClient(rfbClientPtr cl);
extern int rfbReadExact(rfbClientPtr cl, char *buf, int len);
extern int rfbSkipExact(rfbClientPtr cl, int len);
extern int rfbReadExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout);
extern int rfbPeekExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout);
extern int rfbWriteExact(rfbClientPtr cl, const char *buf, int len);
Expand Down
Loading

0 comments on commit 0c3aa75

Please sign in to comment.