-static void
-avahi_client_state_request_callback (DBusPendingCall *call, void *data)
-{
- AvahiClient *client = data;
- DBusError error;
- DBusMessage *reply;
- int state, type;
-
- dbus_error_init (&error);
-
- reply = dbus_pending_call_steal_reply (call);
-
- type = dbus_message_get_type (reply);
-
- if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN)
- {
- dbus_message_get_args (reply, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set (&error))
- return;
-
- avahi_client_set_state (client, state);
- } else if (type == DBUS_MESSAGE_TYPE_ERROR) {
- dbus_set_error_from_message (&error, reply);
- }
-
- dbus_pending_call_unref (call);
-}
-
-static void
-avahi_client_schedule_state_request (AvahiClient *client)
-{
- DBusMessage *message;
- DBusPendingCall *pcall;
-
- /*** Lennart says that this can't happen this way since it will
- * never be called if no main loop is used. This call has to
- * happen synchronously */
-
- if (client == NULL) return;
-
- message = dbus_message_new_method_call (AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "GetState");
-
- dbus_connection_send_with_reply (client->bus, message, &pcall, -1);
-
- dbus_pending_call_set_notify (pcall, avahi_client_state_request_callback, client, NULL);
-}
-