[Spice-devel] [PATCH 11/26] server/red_channel (all): pass header in channel_send_pipe_item_proc

Marc-André Lureau marcandre.lureau at gmail.com
Mon Feb 14 17:38:46 PST 2011


nack, we loose encapsulation here too.

On Fri, Feb 11, 2011 at 6:48 PM, Alon Levy <alevy at redhat.com> wrote:
> ---
>  server/inputs_channel.c    |    3 ++-
>  server/main_channel.c      |    3 ++-
>  server/red_channel.c       |    2 +-
>  server/red_channel.h       |    3 ++-
>  server/red_tunnel_worker.c |    3 ++-
>  server/red_worker.c        |    6 ++++--
>  server/smartcard.c         |    3 ++-
>  7 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/server/inputs_channel.c b/server/inputs_channel.c
> index 459f8f6..772b9d7 100644
> --- a/server/inputs_channel.c
> +++ b/server/inputs_channel.c
> @@ -252,7 +252,8 @@ static void inputs_channel_release_pipe_item(RedChannel *channel,
>     free(base);
>  }
>
> -static void inputs_channel_send_item(RedChannel *channel, SpiceMarshaller *m, PipeItem *base)
> +static void inputs_channel_send_item(RedChannel *channel, SpiceDataHeader *header,
> +                                     SpiceMarshaller *m, PipeItem *base)
>  {
>     red_channel_init_send_data(channel, base->type, base);
>     switch (base->type) {
> diff --git a/server/main_channel.c b/server/main_channel.c
> index 9809fc8..ecb3b4a 100644
> --- a/server/main_channel.c
> +++ b/server/main_channel.c
> @@ -597,7 +597,8 @@ static void main_channel_marshall_multi_media_time(SpiceMarshaller *m,
>     spice_marshall_msg_main_multi_media_time(m, &time_mes);
>  }
>
> -static void main_channel_send_item(RedChannel *channel, SpiceMarshaller *m, PipeItem *base)
> +static void main_channel_send_item(RedChannel *channel, SpiceDataHeader *header,
> +                                   SpiceMarshaller *m, PipeItem *base)
>  {
>     MainChannel *main_chan = SPICE_CONTAINEROF(channel, MainChannel, base);
>
> diff --git a/server/red_channel.c b/server/red_channel.c
> index 44dd99e..fc25ebe 100644
> --- a/server/red_channel.c
> +++ b/server/red_channel.c
> @@ -280,7 +280,7 @@ static void red_channel_send_item(RedChannel *channel, PipeItem *item)
>             return;
>     }
>     /* only reached if not handled here */
> -    channel->send_item(channel, channel->send_data.marshaller, item);
> +    channel->send_item(channel, channel->send_data.header, channel->send_data.marshaller, item);
>  }
>
>  static void red_channel_release_item(RedChannel *channel, PipeItem *item, int item_pushed)
> diff --git a/server/red_channel.h b/server/red_channel.h
> index e3f4f8e..2c2c231 100644
> --- a/server/red_channel.h
> +++ b/server/red_channel.h
> @@ -116,7 +116,8 @@ typedef void (*channel_release_msg_recv_buf_proc)(RedChannel *channel,
>                                                   SpiceDataHeader *msg_header, uint8_t *msg);
>  typedef void (*channel_disconnect_proc)(RedChannel *channel);
>  typedef int (*channel_configure_socket_proc)(RedChannel *channel, RedsStreamContext *peer);
> -typedef void (*channel_send_pipe_item_proc)(RedChannel *channel, SpiceMarshaller *m, PipeItem *item);
> +typedef void (*channel_send_pipe_item_proc)(RedChannel *channel, SpiceDataHeader *header,
> +                                            SpiceMarshaller *m, PipeItem *item);
>  typedef void (*channel_hold_pipe_item_proc)(RedChannel *channel, PipeItem *item);
>  typedef void (*channel_release_pipe_item_proc)(RedChannel *channel,
>                                                PipeItem *item, int item_pushed);
> diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
> index 7018849..1e66358 100644
> --- a/server/red_tunnel_worker.c
> +++ b/server/red_tunnel_worker.c
> @@ -2787,7 +2787,8 @@ static void tunnel_worker_release_socket_out_data(TunnelWorker *worker, PipeItem
>     }
>  }
>
> -static void tunnel_channel_send_item(RedChannel *channel, SpiceMarshaller *m, PipeItem *item)
> +static void tunnel_channel_send_item(RedChannel *channel, SpiceDataHeader *header,
> +                                     SpiceMarshaller *m, PipeItem *item)
>  {
>     TunnelChannel *tunnel_channel = (TunnelChannel *)channel;
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index d7fab60..cac3e12 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -8094,7 +8094,8 @@ static void red_send_surface_destroy(DisplayChannel *display,
>     red_channel_begin_send_message(channel);
>  }
>
> -static void display_channel_send_item(RedChannel *base, SpiceMarshaller *m, PipeItem *pipe_item)
> +static void display_channel_send_item(RedChannel *base, SpiceDataHeader *header,
> +                                      SpiceMarshaller *m, PipeItem *pipe_item)
>  {
>     DisplayChannel *display_channel = (DisplayChannel *)red_ref_channel(base);
>     RedWorker *worker = display_channel->common.worker;
> @@ -8183,7 +8184,8 @@ static void display_channel_send_item(RedChannel *base, SpiceMarshaller *m, Pipe
>     red_unref_channel(&display_channel->common.base);
>  }
>
> -static void cursor_channel_send_item(RedChannel *channel, SpiceMarshaller *m, PipeItem *pipe_item)
> +static void cursor_channel_send_item(RedChannel *channel, SpiceDataHeader *header,
> +                                     SpiceMarshaller *m, PipeItem *pipe_item)
>  {
>     CursorChannel *cursor_channel = SPICE_CONTAINEROF(channel, CursorChannel, common.base);
>
> diff --git a/server/smartcard.c b/server/smartcard.c
> index 4fafc8b..5eb4abd 100644
> --- a/server/smartcard.c
> +++ b/server/smartcard.c
> @@ -306,7 +306,8 @@ static void smartcard_channel_send_msg(
>     smartcard_channel_send_data(&smartcard_channel->base, m, item, msg_item->vheader);
>  }
>
> -static void smartcard_channel_send_item(RedChannel *channel, SpiceMarshaller *m, PipeItem *item)
> +static void smartcard_channel_send_item(RedChannel *channel, SpiceDataHeader *header,
> +                                        SpiceMarshaller *m, PipeItem *item)
>  {
>     SmartCardChannel *smartcard_channel = (SmartCardChannel *)channel;
>
> --
> 1.7.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list