Re: [Spice-devel] [PATCH spice] rcc: Make OutgoingHandler private

2016-10-14 Thread Frediano Ziglio
> 
> ---
>  server/red-channel-client-private.h | 12 
>  server/red-channel-client.c | 10 +-
>  server/red-channel-client.h | 11 ---
>  3 files changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/server/red-channel-client-private.h
> b/server/red-channel-client-private.h
> index f94e042..83fef23 100644
> --- a/server/red-channel-client-private.h
> +++ b/server/red-channel-client-private.h
> @@ -21,6 +21,16 @@
>  #include "red-channel.h"
>  #include "red-channel-client.h"
>  
> +typedef struct OutgoingHandler {
> +OutgoingHandlerInterface *cb;
> +void *opaque;
> +struct iovec vec_buf[IOV_MAX];
> +int vec_size;
> +struct iovec *vec;
> +int pos;
> +int size;
> +} OutgoingHandler;
> +
>  struct RedChannelClientPrivate
>  {
>  RedChannel *channel;
> @@ -70,6 +80,8 @@ struct RedChannelClientPrivate
>  
>  RedChannelClientLatencyMonitor latency_monitor;
>  RedChannelClientConnectivityMonitor connectivity_monitor;
> +
> +OutgoingHandler outgoing;
>  };
>  
>  #endif /* _H_RED_CHANNEL_CLIENT_PRIVATE */
> diff --git a/server/red-channel-client.c b/server/red-channel-client.c
> index e860390..36d9c33 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -874,10 +874,10 @@ static gboolean
> red_channel_client_initable_init(GInitable *initable,
>  self->incoming.cb = >priv->channel->incoming_cb;
>  self->incoming.header.data = self->incoming.header_buf;
>  
> -self->outgoing.opaque = self;
> -self->outgoing.cb = >priv->channel->outgoing_cb;
> -self->outgoing.pos = 0;
> -self->outgoing.size = 0;
> +self->priv->outgoing.opaque = self;
> +self->priv->outgoing.cb = >priv->channel->outgoing_cb;
> +self->priv->outgoing.pos = 0;
> +self->priv->outgoing.size = 0;
>  
>  g_queue_init(>priv->pipe);
>  if (self->priv->stream)
> @@ -1189,7 +1189,7 @@ void red_channel_client_receive(RedChannelClient *rcc)
>  void red_channel_client_send(RedChannelClient *rcc)
>  {
>  g_object_ref(rcc);
> -red_peer_handle_outgoing(rcc->priv->stream, >outgoing);
> +red_peer_handle_outgoing(rcc->priv->stream, >priv->outgoing);
>  g_object_unref(rcc);
>  }
>  
> diff --git a/server/red-channel-client.h b/server/red-channel-client.h
> index 0b180b3..4645d25 100644
> --- a/server/red-channel-client.h
> +++ b/server/red-channel-client.h
> @@ -192,16 +192,6 @@ gboolean
> red_channel_client_set_migration_seamless(RedChannelClient *rcc);
>  void red_channel_client_set_destroying(RedChannelClient *rcc);
>  gboolean red_channel_client_is_destroying(RedChannelClient *rcc);
>  
> -typedef struct OutgoingHandler {
> -OutgoingHandlerInterface *cb;
> -void *opaque;
> -struct iovec vec_buf[IOV_MAX];
> -int vec_size;
> -struct iovec *vec;
> -int pos;
> -int size;
> -} OutgoingHandler;
> -
>  typedef struct IncomingHandler {
>  IncomingHandlerInterface *cb;
>  void *opaque;
> @@ -217,7 +207,6 @@ struct RedChannelClient
>  GObject parent;
>  
>  /* protected */
> -OutgoingHandler outgoing;
>  IncomingHandler incoming;
>  
>  RedChannelClientPrivate *priv;

red-channel-client-private.h is included quite a lot however
outgoing field is used only by RedChannelClient code so it's
fine.

I tried to rebase refactory patches on top of this and it's not
too complicate so

Acked-by: Frediano Ziglio 

Frediano
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH spice] rcc: Make OutgoingHandler private

2016-10-14 Thread Pavel Grunt
---
 server/red-channel-client-private.h | 12 
 server/red-channel-client.c | 10 +-
 server/red-channel-client.h | 11 ---
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/server/red-channel-client-private.h 
b/server/red-channel-client-private.h
index f94e042..83fef23 100644
--- a/server/red-channel-client-private.h
+++ b/server/red-channel-client-private.h
@@ -21,6 +21,16 @@
 #include "red-channel.h"
 #include "red-channel-client.h"
 
+typedef struct OutgoingHandler {
+OutgoingHandlerInterface *cb;
+void *opaque;
+struct iovec vec_buf[IOV_MAX];
+int vec_size;
+struct iovec *vec;
+int pos;
+int size;
+} OutgoingHandler;
+
 struct RedChannelClientPrivate
 {
 RedChannel *channel;
@@ -70,6 +80,8 @@ struct RedChannelClientPrivate
 
 RedChannelClientLatencyMonitor latency_monitor;
 RedChannelClientConnectivityMonitor connectivity_monitor;
+
+OutgoingHandler outgoing;
 };
 
 #endif /* _H_RED_CHANNEL_CLIENT_PRIVATE */
diff --git a/server/red-channel-client.c b/server/red-channel-client.c
index e860390..36d9c33 100644
--- a/server/red-channel-client.c
+++ b/server/red-channel-client.c
@@ -874,10 +874,10 @@ static gboolean 
red_channel_client_initable_init(GInitable *initable,
 self->incoming.cb = >priv->channel->incoming_cb;
 self->incoming.header.data = self->incoming.header_buf;
 
-self->outgoing.opaque = self;
-self->outgoing.cb = >priv->channel->outgoing_cb;
-self->outgoing.pos = 0;
-self->outgoing.size = 0;
+self->priv->outgoing.opaque = self;
+self->priv->outgoing.cb = >priv->channel->outgoing_cb;
+self->priv->outgoing.pos = 0;
+self->priv->outgoing.size = 0;
 
 g_queue_init(>priv->pipe);
 if (self->priv->stream)
@@ -1189,7 +1189,7 @@ void red_channel_client_receive(RedChannelClient *rcc)
 void red_channel_client_send(RedChannelClient *rcc)
 {
 g_object_ref(rcc);
-red_peer_handle_outgoing(rcc->priv->stream, >outgoing);
+red_peer_handle_outgoing(rcc->priv->stream, >priv->outgoing);
 g_object_unref(rcc);
 }
 
diff --git a/server/red-channel-client.h b/server/red-channel-client.h
index 0b180b3..4645d25 100644
--- a/server/red-channel-client.h
+++ b/server/red-channel-client.h
@@ -192,16 +192,6 @@ gboolean 
red_channel_client_set_migration_seamless(RedChannelClient *rcc);
 void red_channel_client_set_destroying(RedChannelClient *rcc);
 gboolean red_channel_client_is_destroying(RedChannelClient *rcc);
 
-typedef struct OutgoingHandler {
-OutgoingHandlerInterface *cb;
-void *opaque;
-struct iovec vec_buf[IOV_MAX];
-int vec_size;
-struct iovec *vec;
-int pos;
-int size;
-} OutgoingHandler;
-
 typedef struct IncomingHandler {
 IncomingHandlerInterface *cb;
 void *opaque;
@@ -217,7 +207,6 @@ struct RedChannelClient
 GObject parent;
 
 /* protected */
-OutgoingHandler outgoing;
 IncomingHandler incoming;
 
 RedChannelClientPrivate *priv;
-- 
2.10.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel