summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-10-03 14:40:18 +0000
committerdscho <dscho>2005-10-03 14:40:18 +0000
commit8490de3ff0e488233d7047d7e6ba3b5c278c5484 (patch)
treeec7395a2942fb1aa37a66240f86f473a68f87ef6
parent1a20edd73f930424b658b7bedfbe4dd653cdf06c (diff)
downloadlibtdevnc-8490de3ff0e488233d7047d7e6ba3b5c278c5484.tar.gz
libtdevnc-8490de3ff0e488233d7047d7e6ba3b5c278c5484.zip
add enablePseudoEncoding() to rfbProtocolExtension
-rw-r--r--ChangeLog6
-rw-r--r--libvncserver/rfbserver.c31
-rw-r--r--libvncserver/tightvnc-filetransfer/rfbtightserver.c2
-rw-r--r--rfb/rfb.h3
4 files changed, 34 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d252555..39b35a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-03 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
+ * libvncserver/rfbserver.c, rfb/rfb.h: add a method to the
+ extension struct which is called to enable pseudo encodings.
+ This is a versatile mechanism to enable/disable custom
+ extensions with custom clients and servers.
+
2005-09-28 Rohit Kumar <rokumar@novell.com>
* examples/filetransfer.c, rfb/rfb.h, configure.ac,
libvncserver/{auth,cargs,main,rfbserver,sockets}.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, "
diff --git a/libvncserver/tightvnc-filetransfer/rfbtightserver.c b/libvncserver/tightvnc-filetransfer/rfbtightserver.c
index 825fce0..013aa2e 100644
--- a/libvncserver/tightvnc-filetransfer/rfbtightserver.c
+++ b/libvncserver/tightvnc-filetransfer/rfbtightserver.c
@@ -156,7 +156,6 @@ static void
rfbSendAuthCaps(cl)
rfbClientPtr cl;
{
- rfbBool authRequired;
rfbAuthenticationCapsMsg caps;
rfbCapabilityInfo caplist[MAX_AUTH_CAPS];
int count = 0;
@@ -485,6 +484,7 @@ rfbHandleSecTypeTight(rfbClientPtr cl) {
rfbProtocolExtension tightVncFileTransferExtension = {
NULL,
rfbTightExtensionInit,
+ NULL,
rfbTightExtensionMsgHandler,
rfbTightExtensionClientClose,
rfbTightUsage,
diff --git a/rfb/rfb.h b/rfb/rfb.h
index fa7d7d7..f7ba150 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -165,6 +165,9 @@ typedef struct _rfbProtocolExtension {
/* returns FALSE if extension should be deactivated for client.
if init == NULL, it stays activated. */
rfbBool (*init)(struct _rfbClientRec* client, void* data);
+ /* returns TRUE if that pseudo encoding is handled by the extension */
+ rfbBool (*enablePseudoEncoding)(struct _rfbClientRec* client,
+ void* data, int encodingNumber);
/* returns TRUE if message was handled */
rfbBool (*handleMessage)(struct _rfbClientRec* client,
void* data,