From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9v56-0001dD-Me for qemu-devel@nongnu.org; Thu, 06 May 2010 03:01:12 -0400 Received: from [140.186.70.92] (port=37454 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9v55-0001a6-Cb for qemu-devel@nongnu.org; Thu, 06 May 2010 03:01:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9v4x-0007vy-05 for qemu-devel@nongnu.org; Thu, 06 May 2010 03:01:10 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:41502) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9v4w-0007vB-3V for qemu-devel@nongnu.org; Thu, 06 May 2010 03:01:02 -0400 Received: by bwz1 with SMTP id 1so3584870bwz.2 for ; Thu, 06 May 2010 00:00:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1272974518-20144-1-git-send-email-corentincj@iksaif.net> References: <4BDEEB03.9070009@linux.vnet.ibm.com> <1272974518-20144-1-git-send-email-corentincj@iksaif.net> Date: Thu, 6 May 2010 09:00:58 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] vnc: set the right prefered encoding From: Corentin Chary Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Corentin Chary , Anthony Liguori On Tue, May 4, 2010 at 2:01 PM, Corentin Chary wrot= e: > From RFB specs: "The order of the encoding types given in this > message is a hint by the client as to its preference (the first > encoding specified being most preferred)" > > Signed-off-by: Corentin Chary > --- > =A0vnc.c | =A0 14 ++++++++++---- > =A01 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/vnc.c b/vnc.c > index 5241a6a..2d05d8f 100644 > --- a/vnc.c > +++ b/vnc.c > @@ -1594,7 +1594,7 @@ static void set_encodings(VncState *vs, int32_t *en= codings, size_t n_encodings) > > =A0 =A0 vnc_zlib_init(vs); > =A0 =A0 vs->features =3D 0; > - =A0 =A0vs->vnc_encoding =3D 0; > + =A0 =A0vs->vnc_encoding =3D -1; > =A0 =A0 vs->tight_compression =3D 9; > =A0 =A0 vs->tight_quality =3D 9; > =A0 =A0 vs->absolute =3D -1; > @@ -1603,18 +1603,24 @@ static void set_encodings(VncState *vs, int32_t *= encodings, size_t n_encodings) > =A0 =A0 =A0 =A0 enc =3D encodings[i]; > =A0 =A0 =A0 =A0 switch (enc) { > =A0 =A0 =A0 =A0 case VNC_ENCODING_RAW: > - =A0 =A0 =A0 =A0 =A0 =A0vs->vnc_encoding =3D enc; > + =A0 =A0 =A0 =A0 =A0 =A0if (vs->vnc_encoding !=3D -1) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vs->vnc_encoding =3D enc; > + =A0 =A0 =A0 =A0 =A0 =A0} hum patch is broken, sending a fixed patch today, sorry should be if (vs->vnc_encoding =3D=3D -1) --=20 Corentin Chary http://xf.iksaif.net