gdbus: Call check_signals when sending signals with g_dbus_send_message

If message passed to g_dbus_send_message is a signal verify if it is a
valid and there really exists an interface with respective signal name.
This commit is contained in:
Luiz Augusto von Dentz 2012-12-28 14:51:03 +02:00 committed by Marcel Holtmann
parent 5ad2dcf2b2
commit 68ff13358d

View File

@ -1511,6 +1511,15 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
dbus_message_set_no_reply(message, TRUE);
else if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) {
const char *path = dbus_message_get_path(message);
const char *interface = dbus_message_get_interface(message);
const char *name = dbus_message_get_member(message);
const GDBusArgInfo *args;
if (!check_signal(connection, path, interface, name, &args))
return FALSE;
}
result = dbus_connection_send(connection, message, NULL);