summaryrefslogtreecommitdiffstats
path: root/uca-net-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-12 10:22:36 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-12 10:22:36 +0200
commit9badf033d3ecea4d3bde6bbbb2ac80f389b822ef (patch)
tree0b32d2680853b43ac0fc7d5b55d88ccf3f7ec11a /uca-net-camera.c
parent9694246130cd69c91b11a5002d8daaa854262f87 (diff)
downloaduca-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 'uca-net-camera.c')
-rw-r--r--uca-net-camera.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/uca-net-camera.c b/uca-net-camera.c
index 39f591f..f265fc6 100644
--- a/uca-net-camera.c
+++ b/uca-net-camera.c
@@ -521,15 +521,22 @@ static void
read_property_reply (GObject *object, GInputStream *input, guint index, GError **error)
{
UcaNetMessageProperty property;
+ GParamSpec *pspec;
- if (g_input_stream_read_all (input, &property, sizeof (property), NULL, NULL, error)) {
- GParamSpec *pspec;
-
- pspec = deserialize_param_spec (&property);
+ if (!g_input_stream_read_all (input, &property, sizeof (property), NULL, NULL, error)) {
+ g_warning ("Could not read all property data");
+ return;
+ }
- if (pspec != NULL)
- g_object_class_install_property (G_OBJECT_GET_CLASS (object), N_PROPERTIES + index + 1, pspec);
+ if (!property.valid) {
+ g_warning ("Cannot install unserialized property `%s'", property.name);
+ return;
}
+
+ pspec = deserialize_param_spec (&property);
+
+ if (pspec != NULL)
+ g_object_class_install_property (G_OBJECT_GET_CLASS (object), N_PROPERTIES + index + 1, pspec);
}
static void