From 978a35f467f9219ee3d3a25e93272697581ea19e Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 11 Mar 2013 16:29:10 +0100 Subject: Add ZRLE encoding which doesnt seem to be supported ..but lets test it further, maybe its just an implementation fault. --- econproxy.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'econproxy.c') diff --git a/econproxy.c b/econproxy.c index c7919f9..f1e55a1 100644 --- a/econproxy.c +++ b/econproxy.c @@ -542,6 +542,26 @@ rfb_retrieve_framebuffer_update(struct ep *ep, } break; +#endif +#if 0 + /* seems to be not supported */ + case 16: /* ZRLE */ + { + uint32_t length; + if (read(ep->vnc_fd, &length, sizeof length) < 0) + goto err; + + length = ntohl(length); + offset = sizeof length; + size = offset + length; + + data = malloc(size); + if (data == NULL) + goto err; + + *((uint32_t *) data) = htonl(length); + } + break; #endif default: goto err; @@ -664,13 +684,13 @@ rfb_init(struct ep *ep) uint8_t cmd; uint8_t padding; uint16_t number_of_encodings; - uint32_t encodings[2]; + uint32_t encodings[3]; } cmd_set_encodings = { - 2, 0, htons(2), + 2, 0, htons(3), #if 1 - { htonl(0) /* RAW */, htonl(7) /* Tight */ } + { htonl(0) /* RAW */, htonl(7) /* Tight */, htonl(16) /* ZRLE */ } #else - { htonl(7) /* Tight */, htonl(0) /* RAW */ } + { htonl(7) /* Tight */, htonl(16) /* ZRLE */, htonl(0) /* RAW */ } #endif }; -- cgit