Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,12 @@ if(WITH_LIBVNCSERVER)
)
endif(WITH_LIBVNCSERVER)

if(WITH_LIBVNCCLIENT)
list(APPEND SIMPLETESTS
client_log_test
)
endif(WITH_LIBVNCCLIENT)


if(WITH_THREADS AND (CMAKE_USE_PTHREADS_INIT OR CMAKE_USE_WIN32_THREADS_INIT) AND WITH_LIBVNCSERVER AND WITH_LIBVNCCLIENT)
set(SIMPLETESTS
Expand Down Expand Up @@ -759,6 +765,9 @@ endif(LIBVNCSERVER_WITH_WEBSOCKETS AND WITH_LIBVNCSERVER)
if(WITH_LIBVNCSERVER)
add_test(NAME cargs COMMAND test_cargstest)
endif(WITH_LIBVNCSERVER)
if(WITH_LIBVNCCLIENT)
add_test(NAME client_log COMMAND test_client_log_test)
endif(WITH_LIBVNCCLIENT)
if(UNIX)
if(WITH_LIBVNCSERVER)
add_test(NAME includetest_server COMMAND ${TESTS_DIR}/includetest.sh ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_MAKE_PROGRAM} "rfb/rfb.h")
Expand Down
12 changes: 12 additions & 0 deletions include/rfb/rfbclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if LIBVNCSERVER_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
Expand Down Expand Up @@ -526,7 +527,18 @@ extern int listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeou

extern rfbBool rfbEnableClientLogging;
typedef void (*rfbClientLogProc)(const char *format, ...);
/**
* Optional client-aware logging callback used by rfbClientLogEx() and
* rfbClientErrEx(). When this callback is NULL, the helpers fall back to the
* legacy global rfbClientLog/rfbClientErr callbacks.
*/
typedef void (*rfbClientLogProcWithClient)(struct _rfbClient *client, const char *format, va_list args);
extern rfbClientLogProc rfbClientLog,rfbClientErr;
extern rfbClientLogProcWithClient rfbClientLogWithClient,rfbClientErrWithClient;
/** Log a message with optional rfbClient context. */
extern void rfbClientLogEx(rfbClient *client, const char *format, ...);
/** Log an error message with optional rfbClient context. */
extern void rfbClientErrEx(rfbClient *client, const char *format, ...);
extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
extern rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort);
extern void SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size);
Expand Down
Loading
Loading