dbus/bus dispatch.c,1.72,1.73 driver.c,1.72,1.73
John Palmieri
johnp at freedesktop.org
Mon Oct 3 12:55:58 PDT 2005
Update of /cvs/dbus/dbus/bus
In directory gabe:/tmp/cvs-serv26394/bus
Modified Files:
dispatch.c driver.c
Log Message:
* bus/driver.c (bus_driver_handle_introspect): Add signals
to the introspect data. (patch from Daniel P. Berrange
<dan at berrange.com>)
* bus/dispatch.c (check_existent_ping): Add testcase for Ping
* dbus/dbus-connection.c (_dbus_connection_peer_filter,
_dbus_connection_run_builtin_filters): Changed these to
be unlock_no_update functions and call
_dbus_connection_send_unlocked_no_update instead of
dbus_connection_send to avoid locking errors.
* doc/TODO: Removed the make Ping test TODO
Index: dispatch.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/dispatch.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- dispatch.c 11 Sep 2005 10:02:47 -0000 1.72
+++ dispatch.c 3 Oct 2005 19:55:56 -0000 1.73
@@ -2877,6 +2877,65 @@
return TRUE;
}
+/* returns TRUE if the correct thing happens,
+ * but the correct thing may include OOM errors.
+ */
+static dbus_bool_t
+check_existent_ping (BusContext *context,
+ DBusConnection *connection)
+{
+ DBusMessage *message;
+ dbus_uint32_t serial;
+ message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME,
+ "/org/freedesktop/TestSuite",
+ "org.freedesktop.DBus.Peer",
+ "Ping");
+
+ if (message == NULL)
+ return TRUE;
+
+ if (!dbus_connection_send (connection, message, &serial))
+ {
+ dbus_message_unref (message);
+ return TRUE;
+ }
+
+ dbus_message_unref (message);
+ message = NULL;
+
+ bus_test_run_everything (context);
+
+ /* Note: if this test is run in OOM mode, it will block when the bus
+ * doesn't send a reply due to OOM.
+ */
+ block_connection_until_message_from_bus (context, connection, "reply from running Ping");
+
+ message = pop_message_waiting_for_memory (connection);
+ if (message == NULL)
+ {
+ _dbus_warn ("Failed to pop message! Should have been reply from Ping message\n");
+ return FALSE;
+ }
+
+ if (dbus_message_get_reply_serial (message) != serial)
+ {
+ _dbus_warn ("Wrong reply serial\n");
+ dbus_message_unref (message);
+ return FALSE;
+ }
+
+ if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN)
+ {
+ _dbus_warn ("Unexpected message return during Ping\n");
+ dbus_message_unref (message);
+ return FALSE;
+ }
+
+ dbus_message_unref (message);
+ message = NULL;
+
+ return TRUE;
+}
/* returns TRUE if the correct thing happens,
* but the correct thing may include OOM errors.
@@ -3053,6 +3112,9 @@
dbus_message_unref (message);
message = NULL;
+ if (!check_existent_ping (context, connection))
+ goto out;
+
if (!check_existent_hello_from_self (context, connection))
goto out;
Index: driver.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/driver.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- driver.c 16 Jul 2005 17:34:08 -0000 1.72
+++ driver.c 3 Oct 2005 19:55:56 -0000 1.73
@@ -1280,6 +1280,45 @@
++i;
}
+
+ if (!_dbus_string_append_printf (&xml, " <signal name=\"NameOwnerChanged\">\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " <arg type=\"s\"/>\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " <arg type=\"s\"/>\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " <arg type=\"s\"/>\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " </signal>\n"))
+ goto oom;
+
+
+
+ if (!_dbus_string_append_printf (&xml, " <signal name=\"NameLost\">\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " <arg type=\"s\"/>\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " </signal>\n"))
+ goto oom;
+
+
+
+ if (!_dbus_string_append_printf (&xml, " <signal name=\"NameAcquired\">\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " <arg type=\"s\"/>\n"))
+ goto oom;
+
+ if (!_dbus_string_append_printf (&xml, " </signal>\n"))
+ goto oom;
+
+
if (!_dbus_string_append (&xml, " </interface>\n"))
goto oom;
More information about the dbus-commit
mailing list