#include "gdbusaddress.h"
#include "gdbusmessage.h"
#include "gdbusconnection.h"
+#include "gkdbusconnection.h"
#include "gdbuserror.h"
#include "gioenumtypes.h"
#include "gdbusintrospection.h"
g_assert_not_reached ();
}
- /* Authenticate the connection */
- if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER)
- {
- g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT));
- g_assert (connection->guid != NULL);
- connection->auth = _g_dbus_auth_new (connection->stream);
- if (!_g_dbus_auth_run_server (connection->auth,
- connection->authentication_observer,
- connection->guid,
- (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS),
- get_offered_capabilities_max (connection),
- &connection->capabilities,
- &connection->credentials,
- cancellable,
- &connection->initialization_error))
- goto out;
- }
- else if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT)
+ if (!G_IS_KDBUS_CONNECTION (connection->stream))
{
- g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER));
- g_assert (connection->guid == NULL);
- connection->auth = _g_dbus_auth_new (connection->stream);
- connection->guid = _g_dbus_auth_run_client (connection->auth,
- connection->authentication_observer,
- get_offered_capabilities_max (connection),
- &connection->capabilities,
- cancellable,
- &connection->initialization_error);
- if (connection->guid == NULL)
- goto out;
- }
-
- if (connection->authentication_observer != NULL)
- {
- g_object_unref (connection->authentication_observer);
- connection->authentication_observer = NULL;
- }
+ /* Authenticate the connection */
+ if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER)
+ {
+ g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT));
+ g_assert (connection->guid != NULL);
+ connection->auth = _g_dbus_auth_new (connection->stream);
+ if (!_g_dbus_auth_run_server (connection->auth,
+ connection->authentication_observer,
+ connection->guid,
+ (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS),
+ get_offered_capabilities_max (connection),
+ &connection->capabilities,
+ &connection->credentials,
+ cancellable,
+ &connection->initialization_error))
+ goto out;
+ }
+ else if (connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT)
+ {
+ g_assert (!(connection->flags & G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER));
+ g_assert (connection->guid == NULL);
+ connection->auth = _g_dbus_auth_new (connection->stream);
+ connection->guid = _g_dbus_auth_run_client (connection->auth,
+ connection->authentication_observer,
+ get_offered_capabilities_max (connection),
+ &connection->capabilities,
+ cancellable,
+ &connection->initialization_error);
+ if (connection->guid == NULL)
+ goto out;
+ }
+ if (connection->authentication_observer != NULL)
+ {
+ g_object_unref (connection->authentication_observer);
+ connection->authentication_observer = NULL;
+ }
+ }
//g_output_stream_flush (G_SOCKET_CONNECTION (connection->stream)
//g_debug ("haz unix fd passing powers: %d", connection->capabilities & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);