Search
j0ke.net Open Build Service
>
Projects
>
virtualization
>
gtk-vnc
> gtk-vnc-0.3.4-protocol-version.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File gtk-vnc-0.3.4-protocol-version.patch of Package gtk-vnc
diff -rup gtk-vnc-0.3.4.orig/src/gvnc.c gtk-vnc-0.3.4.new/src/gvnc.c --- gtk-vnc-0.3.4.orig/src/gvnc.c 2008-04-03 10:16:21.000000000 -0400 +++ gtk-vnc-0.3.4.new/src/gvnc.c 2008-04-03 10:24:25.000000000 -0400 @@ -2775,6 +2775,13 @@ gboolean gvnc_is_initialized(struct gvnc return FALSE; } +static gboolean gvnc_before_version (struct gvnc *gvnc, int major, int minor) { + return (gvnc->major < major) || (gvnc->major == major && gvnc->minor < minor); +} +static gboolean gvnc_after_version (struct gvnc *gvnc, int major, int minor) { + return !gvnc_before_version (gvnc, major, minor+1); +} + gboolean gvnc_initialize(struct gvnc *gvnc, gboolean shared_flag) { int ret, i; @@ -2790,18 +2797,17 @@ gboolean gvnc_initialize(struct gvnc *gv if (ret != 2) goto fail; - if (gvnc->major != 3) - goto fail; - if (gvnc->minor != 3 && - gvnc->minor != 4 && - gvnc->minor != 5 && - gvnc->minor != 6 && - gvnc->minor != 7 && - gvnc->minor != 8) - goto fail; + GVNC_DEBUG("Server version: %d.%d\n", gvnc->major, gvnc->minor); - /* For UltraVNC ... */ - if (gvnc->minor > 3 && gvnc->minor < 7) gvnc->minor = 3; + if (gvnc_before_version(gvnc, 3, 3)) { + GVNC_DEBUG("Server version is not supported (%d.%d)\n", gvnc->major, gvnc->minor); + goto fail; + } else if (gvnc_before_version(gvnc, 3, 7)) { + gvnc->minor = 3; + } else if (gvnc_after_version(gvnc, 3, 8)) { + gvnc->major = 3; + gvnc->minor = 8; + } snprintf(version, 12, "RFB %03d.%03d\n", gvnc->major, gvnc->minor); gvnc_write(gvnc, version, 12);