Commit 8490de3f authored by dscho's avatar dscho

add enablePseudoEncoding() to rfbProtocolExtension

parent 1a20edd7
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,
......
......@@ -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, "
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment