X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-transport.c;h=af5f97b22e9e26764ddd16f2053a654ff84c4307;hb=67f9cca382df0d03adfe6b619aa613d103fa77f6;hp=c483d764547c987850764535ad9232f47372efff;hpb=1f3b479a120002b61d9000828370d743a1d854af;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index c483d76..af5f97b 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -21,7 +21,7 @@ * */ -#include +#include <../config.h> #include "dbus-transport-protected.h" #include "dbus-transport-unix.h" #include "dbus-transport-socket.h" @@ -32,6 +32,8 @@ #include "dbus-credentials.h" #include "dbus-mainloop.h" #include "dbus-message.h" + +#include "dbus-transport-kdbus.h" #ifdef DBUS_BUILD_TESTS #include "dbus-server-debug-pipe.h" #endif @@ -117,7 +119,19 @@ _dbus_transport_init_base (DBusTransport *transport, if (server_guid) auth = _dbus_auth_server_new (server_guid); else - auth = _dbus_auth_client_new (); + { + _dbus_assert (address != NULL); + if (!_dbus_string_copy_data (address, &address_copy)) + { + _dbus_message_loader_unref (loader); + return FALSE; + } + if(address_copy == strstr(address_copy, "kdbus:path=")) + auth = _dbus_auth_client_new_kdbus(); + else + auth = _dbus_auth_client_new (); + } + if (auth == NULL) { _dbus_message_loader_unref (loader); @@ -146,19 +160,6 @@ _dbus_transport_init_base (DBusTransport *transport, _dbus_assert (address == NULL); address_copy = NULL; } - else - { - _dbus_assert (address != NULL); - - if (!_dbus_string_copy_data (address, &address_copy)) - { - _dbus_credentials_unref (creds); - _dbus_counter_unref (counter); - _dbus_auth_unref (auth); - _dbus_message_loader_unref (loader); - return FALSE; - } - } transport->refcount = 1; transport->vtable = vtable; @@ -347,6 +348,7 @@ static const struct { } open_funcs[] = { { _dbus_transport_open_socket }, { _dbus_transport_open_platform_specific }, + { _dbus_transport_open_kdbus }, { _dbus_transport_open_autolaunch } #ifdef DBUS_BUILD_TESTS , { _dbus_transport_open_debug_pipe } @@ -989,7 +991,7 @@ recover_unused_bytes (DBusTransport *transport) const DBusString *encoded; DBusString *buffer; int orig_len; - + if (!_dbus_string_init (&plaintext)) goto nomem; @@ -1002,12 +1004,12 @@ recover_unused_bytes (DBusTransport *transport) _dbus_string_free (&plaintext); goto nomem; } - + _dbus_message_loader_get_buffer (transport->loader, &buffer); orig_len = _dbus_string_get_length (buffer); - + if (!_dbus_string_move (&plaintext, 0, buffer, orig_len)) { @@ -1039,7 +1041,7 @@ recover_unused_bytes (DBusTransport *transport) &buffer); orig_len = _dbus_string_get_length (buffer); - + _dbus_auth_get_unused_bytes (transport->auth, &bytes);