[Spice-commits] server/char-device.c server/char-device.h server/red-stream-device.c server/spicevmc.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 16 13:46:08 UTC 2020
server/char-device.c | 6 ++++--
server/char-device.h | 3 ++-
server/red-stream-device.c | 6 ------
server/spicevmc.c | 7 -------
4 files changed, 6 insertions(+), 16 deletions(-)
New commits:
commit 5bcfc2b5d5adf45d0413c1f71e2d9b5c2f05bbae
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Sep 24 13:08:08 2019 +0100
char-device: Allow send_msg_to_client callback to be NULL
Mostly of the callback dealing with sent messages and tokens
can be NULL.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/char-device.c b/server/char-device.c
index 0b7def3e..927c43ff 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -114,9 +114,11 @@ red_char_device_send_msg_to_client(RedCharDevice *dev,
RedPipeItem *msg,
RedCharDeviceClientOpaque *client)
{
- RedCharDeviceClass *klass = RED_CHAR_DEVICE_GET_CLASS(dev);
+ RedCharDeviceClass *klass = RED_CHAR_DEVICE_GET_CLASS(dev);
- klass->send_msg_to_client(dev, msg, client);
+ if (klass->send_msg_to_client != NULL) {
+ klass->send_msg_to_client(dev, msg, client);
+ }
}
static void
diff --git a/server/char-device.h b/server/char-device.h
index 830ca456..c9ef9eae 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -63,7 +63,8 @@ struct RedCharDeviceClass
* or till the reading fails */
RedPipeItem* (*read_one_msg_from_device)(RedCharDevice *self,
SpiceCharDeviceInstance *sin);
- /* after this call, the message is unreferenced */
+ /* After this call, the message is unreferenced.
+ * Can be NULL. */
void (*send_msg_to_client)(RedCharDevice *self,
RedPipeItem *msg,
RedCharDeviceClientOpaque *client);
diff --git a/server/red-stream-device.c b/server/red-stream-device.c
index 44d9cd09..15262334 100644
--- a/server/red-stream-device.c
+++ b/server/red-stream-device.c
@@ -566,11 +566,6 @@ handle_msg_cursor_move(StreamDevice *dev, SpiceCharDeviceInstance *sin)
return true;
}
-static void
-stream_device_send_msg_to_client(RedCharDevice *self, RedPipeItem *msg, RedClient *client)
-{
-}
-
static void
stream_device_remove_client(RedCharDevice *self, RedClient *client)
{
@@ -779,7 +774,6 @@ stream_device_class_init(StreamDeviceClass *klass)
object_class->finalize = stream_device_finalize;
char_dev_class->read_one_msg_from_device = stream_device_read_msg_from_dev;
- char_dev_class->send_msg_to_client = stream_device_send_msg_to_client;
char_dev_class->remove_client = stream_device_remove_client;
char_dev_class->port_event = stream_device_port_event;
}
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 325c3fe1..4f0f8906 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -376,12 +376,6 @@ static RedPipeItem *spicevmc_chardev_read_msg_from_dev(RedCharDevice *self,
return NULL;
}
-static void spicevmc_chardev_send_msg_to_client(RedCharDevice *self,
- RedPipeItem *msg,
- RedClient *client)
-{
-}
-
static void red_port_init_item_free(struct RedPipeItem *base)
{
RedPortInitPipeItem *item = SPICE_UPCAST(RedPortInitPipeItem, base);
@@ -912,7 +906,6 @@ red_char_device_spicevmc_class_init(RedCharDeviceSpiceVmcClass *klass)
object_class->dispose = red_char_device_spicevmc_dispose;
char_dev_class->read_one_msg_from_device = spicevmc_chardev_read_msg_from_dev;
- char_dev_class->send_msg_to_client = spicevmc_chardev_send_msg_to_client;
char_dev_class->remove_client = spicevmc_char_dev_remove_client;
char_dev_class->port_event = spicevmc_port_event;
char_dev_class->on_free_self_token = spicevmc_on_free_self_token;
More information about the Spice-commits
mailing list