From 8490de3ff0e488233d7047d7e6ba3b5c278c5484 Mon Sep 17 00:00:00 2001 From: dscho Date: Mon, 3 Oct 2005 14:40:18 +0000 Subject: add enablePseudoEncoding() to rfbProtocolExtension --- libvncserver/rfbserver.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'libvncserver/rfbserver.c') diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index 0c25f80..4b67aa1 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -105,7 +105,7 @@ rfbClientListInit(rfbScreenInfoPtr rfbScreen) { if(sizeof(rfbBool)!=1) { /* a sanity check */ - fprintf(stderr,"rfbBool's size is not 1 (%d)!\n",sizeof(rfbBool)); + fprintf(stderr,"rfbBool's size is not 1 (%d)!\n",(int)sizeof(rfbBool)); /* we cannot continue, because rfbBool is supposed to be char everywhere */ exit(1); } @@ -924,8 +924,22 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) #endif } else #endif - rfbLog("rfbProcessClientNormalMessage: ignoring unknown " - "encoding type %d\n", (int)enc); + { + rfbExtensionData* e; + for(e = cl->extensions; e;) { + rfbExtensionData* next = e->next; + if(e->extension->enablePseudoEncoding && + e->extension->enablePseudoEncoding(cl, + e->data, (int)enc)) + /* ext handles this encoding */ + break; + e = next; + } + if(e == NULL) + rfbLog("rfbProcessClientNormalMessage: ignoring" + "unknown encoding type %d\n", + (int)enc); + } } } @@ -1071,12 +1085,15 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) default: { - rfbExtensionData* extension; + rfbExtensionData *e,*next; - for(extension=cl->extensions; extension; extension=extension->next) - if(extension->extension->handleMessage && - extension->extension->handleMessage(cl, extension->data, &msg)) + for(e=cl->extensions; e;) { + next = e->next; + if(e->extension->handleMessage && + e->extension->handleMessage(cl, e->data, &msg)) return; + e = next; + } if(cl->screen->processCustomClientMessage(cl,msg.type)) { rfbLog("Warning: this program uses processCustomClientMessage, " -- cgit v1.2.1