diff options
Diffstat (limited to 'avahi-daemon')
-rw-r--r-- | avahi-daemon/Server.introspect | 5 | ||||
-rw-r--r-- | avahi-daemon/dbus-protocol.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/avahi-daemon/Server.introspect b/avahi-daemon/Server.introspect index ec2f042..5a3f88b 100644 --- a/avahi-daemon/Server.introspect +++ b/avahi-daemon/Server.introspect @@ -32,10 +32,15 @@ </interface> <interface name="org.freedesktop.Avahi.Server"> + <method name="GetVersionString"> <arg name="version" type="s" direction="out"/> </method> + <method name="GetAPIVersion"> + <arg name="version" type="u" direction="out"/> + </method> + <method name="GetHostName"> <arg name="name" type="s" direction="out"/> </method> diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index f01837a..bd26c8c 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -261,6 +261,15 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH return avahi_dbus_respond_string(c, m, PACKAGE_STRING); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAPIVersion")) { + + if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) { + avahi_log_warn("Error parsing Server::GetAPIVersion message"); + goto fail; + } + + return avahi_dbus_respond_uint32(c, m, AVAHI_DBUS_API_VERSION); + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetState")) { AvahiServerState state; @@ -594,7 +603,6 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); |