summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorFloris Bos <bos@je-eigen-domein.nl>2015-01-16 15:54:39 +0100
committerFloris Bos <bos@je-eigen-domein.nl>2015-01-16 15:54:39 +0100
commita48035a1ce6b5fa9738e9f1762294ddfe52b8d57 (patch)
tree22ea3d6c0baf8c5d790593a1038bc0e4063d6702 /libvncserver
parent4674d4632b9ffc6779d9c9f79b8ebb53c12e29b2 (diff)
downloadlibtdevnc-a48035a1ce6b5fa9738e9f1762294ddfe52b8d57.tar.gz
libtdevnc-a48035a1ce6b5fa9738e9f1762294ddfe52b8d57.zip
Only advertise xvp support when xvpHook is set
Prevent that clients show "reboot" "power down" buttons that are not going to work. Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Diffstat (limited to 'libvncserver')
-rw-r--r--libvncserver/rfbserver.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index f1c7c94..b2532e3 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -953,7 +953,6 @@ rfbSendSupportedMessages(rfbClientPtr cl)
/*rfbSetBit(msgs.client2server, rfbSetSW); */
/*rfbSetBit(msgs.client2server, rfbTextChat); */
rfbSetBit(msgs.client2server, rfbPalmVNCSetScaleFactor);
- rfbSetBit(msgs.client2server, rfbXvp);
rfbSetBit(msgs.server2client, rfbFramebufferUpdate);
rfbSetBit(msgs.server2client, rfbSetColourMapEntries);
@@ -961,7 +960,11 @@ rfbSendSupportedMessages(rfbClientPtr cl)
rfbSetBit(msgs.server2client, rfbServerCutText);
rfbSetBit(msgs.server2client, rfbResizeFrameBuffer);
rfbSetBit(msgs.server2client, rfbPalmVNCReSizeFrameBuffer);
- rfbSetBit(msgs.server2client, rfbXvp);
+
+ if (cl->screen->xvpHook) {
+ rfbSetBit(msgs.client2server, rfbXvp);
+ rfbSetBit(msgs.server2client, rfbXvp);
+ }
memcpy(&cl->updateBuf[cl->ublen], (char *)&msgs, sz_rfbSupportedMessages);
cl->ublen += sz_rfbSupportedMessages;
@@ -2214,13 +2217,15 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
cl->enableServerIdentity = TRUE;
}
break;
- case rfbEncodingXvp:
- rfbLog("Enabling Xvp protocol extension for client "
- "%s\n", cl->host);
- if (!rfbSendXvp(cl, 1, rfbXvp_Init)) {
- rfbCloseClient(cl);
- return;
- }
+ case rfbEncodingXvp:
+ if (cl->screen->xvpHook) {
+ rfbLog("Enabling Xvp protocol extension for client "
+ "%s\n", cl->host);
+ if (!rfbSendXvp(cl, 1, rfbXvp_Init)) {
+ rfbCloseClient(cl);
+ return;
+ }
+ }
break;
default:
#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)