diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-13 21:25:09 +0000 |
commit | 4f0a5e7572a4257894b4bfede42c26d65152609e (patch) | |
tree | 21e3d5ee20716739590e5931859a4c2052161395 /avahi-daemon/dbus-protocol.c | |
parent | d6d7d3769441b73ffb5b7af34fef823b41e66312 (diff) | |
download | avahi-4f0a5e7572a4257894b4bfede42c26d65152609e.tar.gz |
* 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
Diffstat (limited to 'avahi-daemon/dbus-protocol.c')
-rw-r--r-- | avahi-daemon/dbus-protocol.c | 16 |
1 files changed, 10 insertions, 6 deletions
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)) { |