diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2016-10-25 12:11:31 -0500 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@redhat.com> | 2016-10-25 16:24:03 -0500 |
commit | 35b7f4d5efec5cb7ed12e654dc74b19000f710c2 (patch) | |
tree | b8dabe24d00f634d05861fa3706a2876b5bf72ee | |
parent | 96e94c6f32d4345ea25ef7a474fbd92de03b38ad (diff) |
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 <pgrunt@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
-rw-r--r-- | server/dummy-channel.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 |