diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-10-12 10:22:36 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-10-12 10:22:36 +0200 |
commit | 9badf033d3ecea4d3bde6bbbb2ac80f389b822ef (patch) | |
tree | 0b32d2680853b43ac0fc7d5b55d88ccf3f7ec11a /ucad.c | |
parent | 9694246130cd69c91b11a5002d8daaa854262f87 (diff) | |
download | uca-net-9badf033d3ecea4d3bde6bbbb2ac80f389b822ef.tar.gz uca-net-9badf033d3ecea4d3bde6bbbb2ac80f389b822ef.tar.bz2 uca-net-9badf033d3ecea4d3bde6bbbb2ac80f389b822ef.tar.xz uca-net-9badf033d3ecea4d3bde6bbbb2ac80f389b822ef.zip |
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.
Diffstat (limited to 'ucad.c')
-rw-r--r-- | ucad.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); |