rcc: Make OutgoingHandler private

Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Pavel Grunt 2016-10-14 13:12:24 +02:00 committed by Frediano Ziglio
parent 4dd9e8a93c
commit 40545d0403
3 changed files with 17 additions and 16 deletions

View File

@ -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 */

View File

@ -874,10 +874,10 @@ static gboolean red_channel_client_initable_init(GInitable *initable,
self->incoming.cb = &self->priv->channel->incoming_cb;
self->incoming.header.data = self->incoming.header_buf;
self->outgoing.opaque = self;
self->outgoing.cb = &self->priv->channel->outgoing_cb;
self->outgoing.pos = 0;
self->outgoing.size = 0;
self->priv->outgoing.opaque = self;
self->priv->outgoing.cb = &self->priv->channel->outgoing_cb;
self->priv->outgoing.pos = 0;
self->priv->outgoing.size = 0;
g_queue_init(&self->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, &rcc->outgoing);
red_peer_handle_outgoing(rcc->priv->stream, &rcc->priv->outgoing);
g_object_unref(rcc);
}

View File

@ -191,16 +191,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;
@ -216,7 +206,6 @@ struct RedChannelClient
GObject parent;
/* protected */
OutgoingHandler outgoing;
IncomingHandler incoming;
RedChannelClientPrivate *priv;