[RFC] gdbus: Process changes upon ObjectManager.GetManagedObjects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Lucas De Marchi <lucas.de.marchi@xxxxxxxxx>

If ObjectManager.GetManagedObjects is called, we need to flush all
pending signals for interfaces added/removed, otherwise we might answer
the method saying an interface exists but never send a signal when it's
removed.
---

It's an RFC because it's untested. If anyone can write a proper unit test for
this, it would be good. Otherwise I can probably do it in the weekend.

 gdbus/object.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdbus/object.c b/gdbus/object.c
index 2b6ae31..3d9ab5f 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1108,6 +1108,11 @@ static DBusMessage *get_objects(DBusConnection *connection,
 	if (reply == NULL)
 		return NULL;
 
+	if (data->process_id > 0) {
+		g_source_remove(data->process_id);
+		process_changes(data);
+	}
+
 	dbus_message_iter_init_append(reply, &iter);
 
 	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux