summaryrefslogtreecommitdiff
path: root/server/red-worker.h
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2016-05-23 11:51:22 +0100
committerJonathon Jongsma <jjongsma@redhat.com>2016-05-24 14:56:45 -0500
commit4028fb1c794ef2a212f22b024b1c39f460439e7b (patch)
treef0047b4eb498d2477051ded7e0aeadf7292edccc /server/red-worker.h
parent6c4e86cbe37c29602c31e951e0138d75cfc4c1b9 (diff)
Replace RedChannel::clients with GList
Instead of using a Ring, use a GList to store the list of channel clients. This allows us to iterate the clients without poking inside of the client struct to get the channel_link. This is required in order to make the RedChannelClient struct private.
Diffstat (limited to 'server/red-worker.h')
-rw-r--r--server/red-worker.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/server/red-worker.h b/server/red-worker.h
index d7525e03..63be8b53 100644
--- a/server/red-worker.h
+++ b/server/red-worker.h
@@ -75,19 +75,16 @@ static inline void red_pipe_add_verb(RedChannelClient* rcc, uint16_t verb)
red_channel_client_pipe_add(rcc, &item->base);
}
-#define LINK_TO_RCC(ptr) SPICE_CONTAINEROF(ptr, RedChannelClient, channel_link)
-#define RCC_FOREACH_SAFE(link, next, rcc, channel) \
- SAFE_FOREACH(link, next, channel, &(channel)->clients, rcc, LINK_TO_RCC(link))
+static inline void red_pipe_add_verb_proxy(RedChannelClient *rcc, gpointer data)
+{
+ uint16_t verb = GPOINTER_TO_UINT(data);
+ red_pipe_add_verb(rcc, verb);
+}
static inline void red_pipes_add_verb(RedChannel *channel, uint16_t verb)
{
- RedChannelClient *rcc;
- RingItem *link, *next;
-
- RCC_FOREACH_SAFE(link, next, rcc, channel) {
- red_pipe_add_verb(rcc, verb);
- }
+ red_channel_apply_clients_data(channel, red_pipe_add_verb_proxy, GUINT_TO_POINTER(verb));
}
RedWorker* red_worker_new(QXLInstance *qxl,