GDBus: Only rewrite serial number if g_dbus_message_get_serial() returns 0

While this a dangerous thing to allow (collissions, reply_serial not
matching up etc.), the added flexibility makes this a good trade-off -
for example, with this feature, it's now a lot easier to build message
routers.

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen
2010-07-07 11:02:08 -04:00
parent 746721293b
commit acc9bb2403
2 changed files with 23 additions and 7 deletions

View File

@@ -618,12 +618,14 @@ test_connection_filter (void)
while (data.num_handled == 0)
g_thread_yield ();
g_dbus_message_set_serial (m, 0);
g_dbus_connection_send_message (c, m, &data.serial, &error);
g_assert_no_error (error);
while (data.num_handled == 1)
g_thread_yield ();
g_dbus_message_set_serial (m, 0);
r = g_dbus_connection_send_message_with_reply_sync (c,
m,
-1,
@@ -637,6 +639,7 @@ test_connection_filter (void)
g_dbus_connection_remove_filter (c, filter_id);
g_dbus_message_set_serial (m, 0);
r = g_dbus_connection_send_message_with_reply_sync (c,
m,
-1,