From 35b7f4d5efec5cb7ed12e654dc74b19000f710c2 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 25 Oct 2016 12:11:31 -0500 Subject: [PATCH] Implement vfuncs for DummyChannel 96e94c6f inadvertantly introduced a regression where an assert was triggered in red_channel_constructed for DummyChannel since DummyChannel didn't implement any of the expected RedChannel vfuncs. This patch avoids the assert by assigning some empty vfuncs. Acked-by: Pavel Grunt Signed-off-by: Jonathon Jongsma --- server/dummy-channel.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/server/dummy-channel.c b/server/dummy-channel.c index 3b65bce3..c43221b5 100644 --- a/server/dummy-channel.c +++ b/server/dummy-channel.c @@ -7,9 +7,37 @@ G_DEFINE_TYPE(DummyChannel, dummy_channel, RED_TYPE_CHANNEL) +static int dummy_config_socket(RedChannelClient *self) +{ + return 1; +} + +static void dummy_on_disconnect(RedChannelClient *self) +{ +} + +static uint8_t* dummy_alloc_recv_buf(RedChannelClient *self, + uint16_t type, + uint32_t size) +{ + return NULL; +} + +static void dummy_release_recv_buf(RedChannelClient *self, + uint16_t type, + uint32_t size, + uint8_t *msg) +{ +} + static void dummy_channel_class_init(DummyChannelClass *klass) { + RedChannelClass *channel_class = RED_CHANNEL_CLASS(klass); + channel_class->config_socket = dummy_config_socket; + channel_class->on_disconnect = dummy_on_disconnect; + channel_class->alloc_recv_buf = dummy_alloc_recv_buf; + channel_class->release_recv_buf = dummy_release_recv_buf; } static void