Patchwork [v3,01/12] Revert "vnc: set the right prefered encoding"

login
register
mail settings
Submitter Corentin Chary
Date May 19, 2010, 7:24 a.m.
Message ID <1274253852-16068-2-git-send-email-corentincj@iksaif.net>
Download mbox | patch
Permalink /patch/52951/
State New
Headers show

Comments

Corentin Chary - May 19, 2010, 7:24 a.m.
This patch was wrong, because the loop was already reversed,
so the first encoding was correctly set at the end of the loopp.

This reverts commit 14eb8b6829ad9dee7035de729e083844a425f274.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 vnc.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
Anthony Liguori - June 1, 2010, 6:27 p.m.
On 05/19/2010 02:24 AM, Corentin Chary wrote:
> This patch was wrong, because the loop was already reversed,
> so the first encoding was correctly set at the end of the loopp.
>
> This reverts commit 14eb8b6829ad9dee7035de729e083844a425f274.
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>    

Applied all.  Thanks.

Regards,

Anthony Liguori

> ---
>   vnc.c |   14 ++++----------
>   1 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/vnc.c b/vnc.c
> index 1f7ad73..b1a3fdb 100644
> --- a/vnc.c
> +++ b/vnc.c
> @@ -1594,7 +1594,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>
>       vnc_zlib_init(vs);
>       vs->features = 0;
> -    vs->vnc_encoding = -1;
> +    vs->vnc_encoding = 0;
>       vs->tight_compression = 9;
>       vs->tight_quality = 9;
>       vs->absolute = -1;
> @@ -1603,24 +1603,18 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>           enc = encodings[i];
>           switch (enc) {
>           case VNC_ENCODING_RAW:
> -            if (vs->vnc_encoding != -1) {
> -                vs->vnc_encoding = enc;
> -            }
> +            vs->vnc_encoding = enc;
>               break;
>           case VNC_ENCODING_COPYRECT:
>               vs->features |= VNC_FEATURE_COPYRECT_MASK;
>               break;
>           case VNC_ENCODING_HEXTILE:
>               vs->features |= VNC_FEATURE_HEXTILE_MASK;
> -            if (vs->vnc_encoding != -1) {
> -                vs->vnc_encoding = enc;
> -            }
> +            vs->vnc_encoding = enc;
>               break;
>           case VNC_ENCODING_ZLIB:
>               vs->features |= VNC_FEATURE_ZLIB_MASK;
> -            if (vs->vnc_encoding != -1) {
> -                vs->vnc_encoding = enc;
> -            }
> +            vs->vnc_encoding = enc;
>               break;
>           case VNC_ENCODING_DESKTOPRESIZE:
>               vs->features |= VNC_FEATURE_RESIZE_MASK;
>

Patch

diff --git a/vnc.c b/vnc.c
index 1f7ad73..b1a3fdb 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1594,7 +1594,7 @@  static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
 
     vnc_zlib_init(vs);
     vs->features = 0;
-    vs->vnc_encoding = -1;
+    vs->vnc_encoding = 0;
     vs->tight_compression = 9;
     vs->tight_quality = 9;
     vs->absolute = -1;
@@ -1603,24 +1603,18 @@  static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
         enc = encodings[i];
         switch (enc) {
         case VNC_ENCODING_RAW:
-            if (vs->vnc_encoding != -1) {
-                vs->vnc_encoding = enc;
-            }
+            vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_COPYRECT:
             vs->features |= VNC_FEATURE_COPYRECT_MASK;
             break;
         case VNC_ENCODING_HEXTILE:
             vs->features |= VNC_FEATURE_HEXTILE_MASK;
-            if (vs->vnc_encoding != -1) {
-                vs->vnc_encoding = enc;
-            }
+            vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_ZLIB:
             vs->features |= VNC_FEATURE_ZLIB_MASK;
-            if (vs->vnc_encoding != -1) {
-                vs->vnc_encoding = enc;
-            }
+            vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_DESKTOPRESIZE:
             vs->features |= VNC_FEATURE_RESIZE_MASK;