From 9badf033d3ecea4d3bde6bbbb2ac80f389b822ef Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 12 Oct 2017 10:22:36 +0200 Subject: Send flag that denotes serialization validity Before, we tried to install an existing property if the new property could not been serialized. Now, we always send a property description but denote if it is properly serialized. --- ucad.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ucad.c') diff --git a/ucad.c b/ucad.c index 09f075c..d2fd300 100644 --- a/ucad.c +++ b/ucad.c @@ -105,7 +105,7 @@ prepare_error_reply (GError *error, UcaNetErrorReply *reply) } } -static gboolean +static void serialize_param_spec (GParamSpec *pspec, UcaNetMessageProperty *prop) { strncpy (prop->name, g_param_spec_get_name (pspec), sizeof (prop->name)); @@ -114,6 +114,7 @@ serialize_param_spec (GParamSpec *pspec, UcaNetMessageProperty *prop) prop->value_type = pspec->value_type; prop->flags = pspec->flags; + prop->valid = TRUE; if (g_type_is_a (pspec->value_type, G_TYPE_ENUM)) { GEnumClass *enum_class; @@ -163,12 +164,11 @@ serialize_param_spec (GParamSpec *pspec, UcaNetMessageProperty *prop) break; default: g_warning ("Cannot serialize property %s", prop->name); - return FALSE; + prop->valid = FALSE; + break; } #undef CASE_NUMERIC - - return TRUE; } static void @@ -186,8 +186,8 @@ handle_get_properties_request (GSocketConnection *connection, UcaCamera *camera, for (guint i = N_BASE_PROPERTIES - 1; i < num_properties; i++) { UcaNetMessageProperty property; - if (serialize_param_spec (pspecs[i], &property)) - send_reply (connection, &property, sizeof (property), error); + serialize_param_spec (pspecs[i], &property); + send_reply (connection, &property, sizeof (property), error); } g_free (pspecs); -- cgit v1.2.3