summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-10-06 19:07:01 +0000
committerdscho <dscho>2005-10-06 19:07:01 +0000
commitd15e35586baac59e5fe585a86d26cb606bd87969 (patch)
tree2a671865dfa9065f7a0ffee7da9d7f659a57163c
parent60f1770e1081e81502dc2ba000c27f730f5c1e7c (diff)
downloadlibtdevnc-d15e35586baac59e5fe585a86d26cb606bd87969.tar.gz
libtdevnc-d15e35586baac59e5fe585a86d26cb606bd87969.zip
kill BackChannel and CustomClientMessage: the new extension technique makes these hooks obsolete
-rw-r--r--configure.ac7
-rw-r--r--examples/mac.c60
-rw-r--r--libvncserver/main.c6
-rw-r--r--libvncserver/rfbserver.c42
-rwxr-xr-xlibvncserver/stats.c4
-rw-r--r--libvncserver/tightvnc-filetransfer/filetransfermsg.c1
-rw-r--r--rfb/rfb.h13
-rw-r--r--rfb/rfbproto.h11
8 files changed, 1 insertions, 143 deletions
diff --git a/configure.ac b/configure.ac
index 84079ee..6f4d1ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,13 +25,6 @@ if test "x$with_tightvnc_filetransfer" == "xyes"; then
AC_DEFINE(WITH_TIGHTVNC_FILETRANSFER)
fi
AM_CONDITIONAL(WITH_TIGHTVNC_FILETRANSFER, test "$with_tightvnc_filetransfer" == "yes")
-AH_TEMPLATE(BACKCHANNEL, [Enable BackChannel communication])
-AC_ARG_WITH(backchannel,
- [ --without-backchannel disable backchannel method],
- , [ with_backchannel=yes ])
-if test "x$with_backchannel" = "xyes"; then
- AC_DEFINE(BACKCHANNEL)
-fi
AH_TEMPLATE(ALLOW24BPP, [Enable 24 bit per pixel in native framebuffer])
AC_ARG_WITH(24bpp,
[ --without-24bpp disable 24 bpp framebuffers],
diff --git a/examples/mac.c b/examples/mac.c
index aca7f14..f33780a 100644
--- a/examples/mac.c
+++ b/examples/mac.c
@@ -27,10 +27,6 @@
*
*/
-#ifdef LOCAL_CONTROL
-#include "1instance.c"
-#endif
-
#include <unistd.h>
#include <ApplicationServices/ApplicationServices.h>
#include <Carbon/Carbon.h>
@@ -476,39 +472,11 @@ ScreenInit(int argc, char**argv)
rfbInitServer(rfbScreen);
}
-#ifdef LOCAL_CONTROL
-single_instance_struct single_instance = { "/tmp/OSXvnc_control" };
-#endif
-
static void
refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore)
{
int i;
-#ifdef LOCAL_CONTROL
- char message[1024];
-
- if(get_next_message(message,1024,&single_instance,50)) {
- if(message[0]=='l' && message[1]==0) {
- rfbClientPtr cl;
- int i;
- for(i=0,cl=rfbScreen->rfbClientHead;cl;cl=cl->next,i++)
- rfbLog("%02d: %s\n",i,cl->host);
- } else if(message[0]=='t') {
- rfbClientPtr cl;
- for(cl=rfbScreen->rfbClientHead;cl;cl=cl->next)
- if(!strcmp(message+1,cl->host)) {
- cl->clientData=(void*)((cl->clientData==0)?-1:0);
- break;
- }
- }
-#ifdef LIBVNCSERVER_BACKCHANNEL
- else if(message[0]=='b')
- rfbSendBackChannel(rfbScreen,message+1,strlen(message+1));
-#endif
- }
-#endif
-
if(startTime>0 && time(0)>startTime+maxSecsToConnect)
rfbShutdown(0);
@@ -541,35 +509,7 @@ int main(int argc,char *argv[])
{
int i;
-#ifdef LOCAL_CONTROL
- char message[1024];
-
- open_control_file(&single_instance);
-#endif
-
for(i=argc-1;i>0;i--)
-#ifdef LOCAL_CONTROL
- if(i<argc-1 && !strcmp(argv[i],"-toggleviewonly")) {
- if(strlen(argv[i+1])>1022)
- argv[i+1][1022]=0;
- sprintf(message,"t%s",argv[i+1]);
- send_message(&single_instance,message);
- exit(0);
- } else if(!strcmp(argv[i],"-listclients")) {
- rfbLog("list clients\n");
- send_message(&single_instance,"l");
- exit(0);
- } else
-#ifdef LIBVNCSERVER_BACKCHANNEL
- if(i<argc-1 && !strcmp(argv[i],"-backchannel")) {
- if(strlen(argv[i+1])>1022)
- argv[i+1][1022]=0;
- sprintf(message,"b%s",argv[i+1]);
- send_message(&single_instance,message);
- exit(0);
- } else
-#endif
-#endif
if(i<argc-1 && strcmp(argv[i],"-wait4client")==0) {
maxSecsToConnect = atoi(argv[i+1])/1000;
startTime = time(0);
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 240d50d..e6908e1 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -596,11 +596,6 @@ static enum rfbNewClientAction rfbDefaultNewClientHook(rfbClientPtr cl)
return RFB_CLIENT_ACCEPT;
}
-static rfbBool rfbDefaultProcessCustomClientMessage(rfbClientPtr cl,uint8_t type)
-{
- return FALSE;
-}
-
/*
* Update server's pixel format in screenInfo structure. This
* function is called from rfbGetScreen() and rfbNewFramebuffer().
@@ -745,7 +740,6 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
screen->setTranslateFunction = rfbSetTranslateFunction;
screen->newClientHook = rfbDefaultNewClientHook;
screen->displayHook = NULL;
- screen->processCustomClientMessage = rfbDefaultProcessCustomClientMessage;
/* initialize client list and iterator mutex */
rfbClientListInit(screen);
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 53ec4f8..652b1b7 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -889,15 +889,6 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
cl->useNewFBSize = TRUE;
}
break;
-#ifdef LIBVNCSERVER_BACKCHANNEL
- case rfbEncodingBackChannel:
- if (!cl->enableBackChannel) {
- rfbLog("Enabling BackChannel protocol extension for "
- "client %s\n", cl->host);
- cl->enableBackChannel = TRUE;
- }
- break;
-#endif
#ifdef LIBVNCSERVER_HAVE_LIBZ
case rfbEncodingZRLE:
if (cl->preferredEncoding == -1) {
@@ -1128,13 +1119,6 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
e = next;
}
- if(cl->screen->processCustomClientMessage(cl,msg.type)) {
- rfbLog("Warning: this program uses processCustomClientMessage, "
- "which is deprecated.\n"
- "Please use rfbRegisterProtocolExtension instead.\n");
- return;
- }
-
rfbLog("rfbProcessClientNormalMessage: unknown message type %d\n",
msg.type);
rfbLog(" ... closing connection\n");
@@ -1857,30 +1841,4 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
}
}
-#ifdef LIBVNCSERVER_BACKCHANNEL
-void rfbSendBackChannel(rfbScreenInfoPtr rfbScreen,char* str,int len)
-{
- rfbClientPtr cl;
- rfbBackChannelMsg sct;
- rfbClientIteratorPtr iterator;
- iterator = rfbGetClientIterator(rfbScreen);
- while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
- if (cl->enableBackChannel) {
- sct.type = rfbBackChannel;
- sct.length = Swap32IfLE(len);
- if (rfbWriteExact(cl, (char *)&sct,
- sz_rfbBackChannelMsg) < 0) {
- rfbLogPerror("rfbSendBackChannel: write");
- rfbCloseClient(cl);
- continue;
- }
- if (rfbWriteExact(cl, str, len) < 0) {
- rfbLogPerror("rfbSendBackChannel: write");
- rfbCloseClient(cl);
- }
- }
- }
- rfbReleaseClientIterator(iterator);
-}
-#endif
diff --git a/libvncserver/stats.c b/libvncserver/stats.c
index cd1bd40..969eeed 100755
--- a/libvncserver/stats.c
+++ b/libvncserver/stats.c
@@ -30,11 +30,7 @@ static const char* encNames[] = {
"raw", "copyRect", "RRE", "[encoding 3]", "CoRRE", "hextile",
"zlib", "tight", "[encoding 8]", "[encoding 9]", "[encoding 10]",
"[encoding 11]", "[encoding 12]", "[encoding 13]", "[encoding 14]",
-#ifdef LIBVNCSERVER_BACKCHANNEL
- "BackChannel",
-#else
"[encoding 15]",
-#endif
"ZRLE", "[encoding 17]", "[encoding 18]", "[encoding 19]", "[encoding 20]"
};
diff --git a/libvncserver/tightvnc-filetransfer/filetransfermsg.c b/libvncserver/tightvnc-filetransfer/filetransfermsg.c
index 6a3a39e..e7f6476 100644
--- a/libvncserver/tightvnc-filetransfer/filetransfermsg.c
+++ b/libvncserver/tightvnc-filetransfer/filetransfermsg.c
@@ -319,6 +319,7 @@ GetFileDownloadResponseMsgInBlocks(rfbClientPtr cl, rfbTightClientPtr rtcp)
}
return CreateFileDownloadBlockSizeDataMsg(numOfBytesRead, pBuf);
}
+ return GetFileDownLoadErrMsg();
}
diff --git a/rfb/rfb.h b/rfb/rfb.h
index bdd895f..3338f7d 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -133,7 +133,6 @@ typedef rfbBool (*rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
typedef rfbBool (*rfbPasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
typedef enum rfbNewClientAction (*rfbNewClientHookPtr)(struct _rfbClientRec* cl);
typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl);
-typedef rfbBool (*rfbProcessCustomClientMessageProcPtr)(struct _rfbClientRec* cl,uint8_t type);
typedef struct {
uint32_t count;
@@ -307,10 +306,6 @@ typedef struct _rfbScreenInfo
* link more interactive. */
int progressiveSliceHeight;
- /* if LibVNCServer doesn't know the normal message, it calls this
- * hook. If the hook handles the message, it returns TRUE. */
- rfbProcessCustomClientMessageProcPtr processCustomClientMessage;
-
in_addr_t listenInterface;
} rfbScreenInfo, *rfbScreenInfoPtr;
@@ -486,10 +481,6 @@ typedef struct _rfbClientRec {
rfbBool useNewFBSize; /* client supports NewFBSize encoding */
rfbBool newFBSizePending; /* framebuffer size was changed */
-#ifdef LIBVNCSERVER_BACKCHANNEL
- rfbBool enableBackChannel; /* custom channel for special clients */
-#endif
-
struct _rfbClientRec *prev;
struct _rfbClientRec *next;
@@ -606,10 +597,6 @@ extern void rfbSendBell(rfbScreenInfoPtr rfbScreen);
void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len);
-#ifdef LIBVNCSERVER_BACKCHANNEL
-extern void rfbSendBackChannel(rfbScreenInfoPtr s,char* message,int len);
-#endif
-
/* translate.c */
extern rfbBool rfbEconomicTranslate;
diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h
index 791b5f3..60ba763 100644
--- a/rfb/rfbproto.h
+++ b/rfb/rfbproto.h
@@ -358,9 +358,6 @@ typedef struct {
#define rfbResizeFrameBuffer 4
#define rfbKeyFrameUpdate 5
#define rfbPalmVNCReSizeFrameBuffer 0xF
-#ifdef LIBVNCSERVER_BACKCHANNEL
-#define rfbBackChannel 15
-#endif
/* client -> server */
@@ -406,9 +403,6 @@ typedef struct {
#define rfbEncodingZlibHex 8
#define rfbEncodingUltra 9
#endif
-#ifdef LIBVNCSERVER_BACKCHANNEL
-#define rfbEncodingBackChannel 15
-#endif
#ifdef LIBVNCSERVER_HAVE_LIBZ
#define rfbEncodingZRLE 16
#endif
@@ -899,11 +893,6 @@ typedef struct {
#define sz_rfbServerCutTextMsg 8
-#ifdef LIBVNCSERVER_BACKCHANNEL
-typedef rfbServerCutTextMsg rfbBackChannelMsg;
-#define sz_rfbBackChannelMsg 8
-#endif
-
/*-----------------------------------------------------------------------------
* // Modif sf@2002