diff options
author | dscho <dscho> | 2002-01-17 09:33:17 +0000 |
---|---|---|
committer | dscho <dscho> | 2002-01-17 09:33:17 +0000 |
commit | 7b90c44708b6b3096419af747e4a4f3470d2d4db (patch) | |
tree | 4214a827c7505e97c6863d00d00b07f82b770d5a /rfbserver.c | |
parent | ba66518fa044cf164cc3d963a248002c45f29538 (diff) | |
download | libtdevnc-7b90c44708b6b3096419af747e4a4f3470d2d4db.tar.gz libtdevnc-7b90c44708b6b3096419af747e4a4f3470d2d4db.zip |
correct BackChannel handling, compile cleanups
Diffstat (limited to 'rfbserver.c')
-rw-r--r-- | rfbserver.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/rfbserver.c b/rfbserver.c index 94533f3..b938d91 100644 --- a/rfbserver.c +++ b/rfbserver.c @@ -709,6 +709,15 @@ rfbProcessClientNormalMessage(cl) cl->enableLastRectEncoding = TRUE; } break; +#ifdef BACKCHANNEL + case rfbEncodingBackChannel: + if (!cl->enableBackChannel) { + rfbLog("Enabling BackChannel protocol extension for " + "client %s\n", cl->host); + cl->enableBackChannel = TRUE; + } + break; +#endif default: if ( enc >= (CARD32)rfbEncodingCompressLevel0 && enc <= (CARD32)rfbEncodingCompressLevel9 ) { @@ -1470,18 +1479,20 @@ void rfbSendBackChannel(rfbScreenInfoPtr rfbScreen,char* str,int len) iterator = rfbGetClientIterator(rfbScreen); while ((cl = rfbClientIteratorNext(iterator)) != NULL) { - sct.type = rfbBackChannel; - sct.length = Swap32IfLE(len); - if (WriteExact(cl, (char *)&sct, - sz_rfbServerCutTextMsg) < 0) { - rfbLogPerror("rfbSendServerCutText: write"); - rfbCloseClient(cl); - continue; - } - if (WriteExact(cl, str, len) < 0) { - rfbLogPerror("rfbSendServerCutText: write"); - rfbCloseClient(cl); - } + if (cl->enableBackChannel) { + sct.type = rfbBackChannel; + sct.length = Swap32IfLE(len); + if (WriteExact(cl, (char *)&sct, + sz_rfbBackChannelMsg) < 0) { + rfbLogPerror("rfbSendBackChannel: write"); + rfbCloseClient(cl); + continue; + } + if (WriteExact(cl, str, len) < 0) { + rfbLogPerror("rfbSendBackChannel: write"); + rfbCloseClient(cl); + } + } } rfbReleaseClientIterator(iterator); } |