PropertiesChanged signal dbus message contains an array of elements that
contain two fields:
First is string type field containing the property name
Second is variant type field containing the property value
Previously the logic in iterating through these properties and the
fields in them wasn't working properly:
sd_bus_message_skip was called with wrong type and the return value
of that wasn't checked: it was actually -6 indicating an error
sd_bus_exit_container was not called after each property element and
before attempting to enter next changed property.
These caused the attempt to enter the second changed property with
sd_bus_message_enter_container to fail with -6. And if multiple
properties had been changed, only first of them was actually checked.
This commit fixes the property type for sd_bus_message_skip call and
adds the missing sd_bus_message_exit_container call. And it also adds
checks for the return value for those two calls and for the
sd_bus_message_enter_container call in order to ensure that failures
in the message parsing cause warning messages to be logged.
PropertiesChanged signal dbus message contains an array of elements that contain two fields:
Previously the logic in iterating through these properties and the fields in them wasn't working properly:
sd_bus_message_skip
was called with wrong type and the return value of that wasn't checked: it was actually -6 indicating an errorsd_bus_exit_container
was not called after each property element and before attempting to enter next changed property.These caused the attempt to enter the second changed property with
sd_bus_message_enter_container
to fail with -6. And if multiple properties had been changed, only first of them was actually checked.This commit fixes the property type for
sd_bus_message_skip
call and adds the missingsd_bus_message_exit_container
call. And it also adds checks for the return value for those two calls and for thesd_bus_message_enter_container
call in order to ensure that failures in the message parsing cause warning messages to be logged.