[Spice-devel] [PATCH spice-gtk 1/2] spice-channel: Store the caps correctly

Christophe Fergeau cfergeau at redhat.com
Thu Jun 29 16:23:53 UTC 2017


On Thu, Jun 29, 2017 at 12:38:35PM +0200, Pavel Grunt wrote:
> The commit babe5630d5d3242b1d186cccdd5b4d51debe78e9 forgot to update
> position of the caps pointer making remote caps to not be stored.
> 
> That cause strange behavior in remote-viewer - it always opened window
> for each remote display.
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>
> Signed-off-by: Pavel Grunt <pgrunt at redhat.com>
> ---
> the lines were reordered to make the two "blocks" look similar, making clear that is possible to factor out the common code.
> ---
>  src/spice-channel.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/spice-channel.c b/src/spice-channel.c
> index 418e2b7..b8cf19c 100644
> --- a/src/spice-channel.c
> +++ b/src/spice-channel.c
> @@ -1938,8 +1938,9 @@ static gboolean spice_channel_recv_link_msg(SpiceChannel *channel)
>          CHANNEL_DEBUG(channel, "got common caps %d:0x%X", i, *caps);
>      }
>  
> -    g_array_set_size(c->remote_caps, num_channel_caps);
>      caps_src += num_common_caps * sizeof(uint32_t);
> +    g_array_set_size(c->remote_caps, num_channel_caps);
> +    caps = &g_array_index(c->remote_caps, uint32_t, 0);


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

>      memcpy(caps, caps_src, num_channel_caps * sizeof(uint32_t));
>      for (i = 0; i < num_channel_caps; i++, caps++) {
>          *caps = GUINT32_FROM_LE(*caps);
> -- 
> 2.13.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170629/7e13c62d/attachment.sig>


More information about the Spice-devel mailing list