From 4f0a5e7572a4257894b4bfede42c26d65152609e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 13 Aug 2005 21:25:09 +0000 Subject: * strip glib from avahi-core * implement glib memory allocator * add new documentation file MALLOC * initialize pseudo-RNG from /dev/urandom in avahi-daemon * remove some gcc 4.0 warnings * beef up watch system with real timeouts * move GCC __attribute__ macros into its own header avahi-common/gccmacro.h * make use of GCC's sentinel attribute where it make sense * add malloc() implementations that abort on OOM and enable them by default git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/dbus-protocol.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'avahi-daemon/dbus-protocol.c') diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 41cef18..6526d7d 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -587,13 +587,15 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState")) { - + AvahiEntryGroupState state; + if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) { avahi_log_warn("Error parsing EntryGroup::GetState message"); goto fail; } - return respond_int32(c, m, (gint32) avahi_entry_group_get_state(i->entry_group)); + state = avahi_entry_group_get_state(i->entry_group); + return respond_int32(c, m, (gint32) state); } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) { gint32 interface, protocol; @@ -1131,13 +1133,15 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_string(c, m, PACKAGE_STRING); } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetState")) { - + AvahiServerState state; + if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) { avahi_log_warn("Error parsing Server::GetState message"); goto fail; } - - return respond_int32(c, m, (gint32) avahi_server_get_state(avahi_server)); + + state = avahi_server_get_state(avahi_server); + return respond_int32(c, m, (gint32) state); } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetNetworkInterfaceNameByIndex")) { gint32 idx; @@ -1618,7 +1622,7 @@ int dbus_protocol_setup(GMainLoop *loop) { } dbus_connection_setup_with_g_main(server->bus, NULL); - dbus_connection_set_exit_on_disconnect(server->bus, FALSE); + dbus_connection_set_exit_on_disconnect(server->bus, TRUE); dbus_bus_request_name(server->bus, AVAHI_DBUS_NAME, 0, &error); if (dbus_error_is_set(&error)) { -- cgit v1.2.1