Re: Client server handshake and missing color maps



On Tue, Apr 22, 2014 at 06:57:27PM +0200, Marco Gidde wrote:
Hello Daniel, hello list,

I noticed and analyzed a gtk-vnc crash, via vinagre on ubuntu 13.10 and
gvncviewer.py on an older SUSE release. The client tried to connect to
an older proprietary VNCserver running on a PLC, RFB version 3.3, maybe
some RealVNC derivative.

It turned out that the server uses 8bit color depth with a color map and
does not accept clients which request different color encodings or true
color. On the other hand the server does not send the color entries
unless the client explicitly sends the SetPixelFormat message.

There is some code/comment in src/vncdisplay.c:1182:

#if 0
        /* TigerVNC always sends back the encoding even if
           unchanged from what the server suggested. This
           does not appear to matter, so lets save the bytes */
        memcpy(&fmt, currentFormat, sizeof(fmt));
        break;
#else
        return TRUE;
#endif

If I activate that code, the client connects successfully, so there
might be a reason why TigerVNC always sends it :-)

Ok, I'm applying the change

diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 259c352..d44980b 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -1179,15 +1179,12 @@ static gboolean vnc_display_set_preferred_pixel_format(VncDisplay *display)
         VNC_DEBUG ("Using default colour depth %d (%d bpp) (true color? %d)",
                    currentFormat->depth, currentFormat->bits_per_pixel,
                    currentFormat->true_color_flag);
-#if 0
         /* TigerVNC always sends back the encoding even if
-           unchanged from what the server suggested. This
-           does not appear to matter, so lets save the bytes */
+           unchanged from what the server suggested. This is
+           important with some VNC servers, since they won't
+           otherwise send us the colour map entries */
         memcpy(&fmt, currentFormat, sizeof(fmt));
         break;
-#else
-        return TRUE;
-#endif
 
     case VNC_DISPLAY_DEPTH_COLOR_FULL:
         fmt.depth = 24;

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]