Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous updates extension from TurboVNC #557

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -783,8 +785,10 @@ if(LIBVNCSERVER_INSTALL)
include/rfb/rfb.h
include/rfb/rfbclient.h
${CMAKE_CURRENT_BINARY_DIR}/include/rfb/rfbconfig.h
include/rfb/rfblist.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