From fe4715b656237b89767b5dc0cba4c107541b6e0d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 16 Sep 2006 19:24:08 +0000 Subject: 2006-09-16 Havoc Pennington * dbus/dbus-transport.c (_dbus_transport_open): modify to delegate to _dbus_transport_open_platform_specific, _dbus_transport_open_socket, and _dbus_transport_open_debug_pipe * dbus/dbus-transport-protected.h: add _dbus_transport_open_platform_specific --- dbus/dbus-server-debug-pipe.c | 46 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'dbus/dbus-server-debug-pipe.c') diff --git a/dbus/dbus-server-debug-pipe.c b/dbus/dbus-server-debug-pipe.c index 62cae0a0..925f8971 100644 --- a/dbus/dbus-server-debug-pipe.c +++ b/dbus/dbus-server-debug-pipe.c @@ -350,8 +350,8 @@ _dbus_server_listen_debug_pipe (DBusAddressEntry *entry, if (name == NULL) { - _dbus_server_set_bad_address(error, "debug-pipe", "name", - NULL); + _dbus_set_bad_address(error, "debug-pipe", "name", + NULL); return DBUS_SERVER_LISTEN_BAD_ADDRESS; } @@ -375,6 +375,48 @@ _dbus_server_listen_debug_pipe (DBusAddressEntry *entry, } } +DBusTransportOpenResult +_dbus_transport_open_debug_pipe (DBusAddressEntry *entry, + DBusTransport **transport_p, + DBusError *error) +{ + const char *method; + + method = dbus_address_entry_get_method (entry); + _dbus_assert (method != NULL); + + if (strcmp (method, "debug-pipe") == 0) + { + const char *name = dbus_address_entry_get_value (entry, "name"); + + if (name == NULL) + { + _dbus_set_bad_address (error, "debug-pipe", "name", + NULL); + return DBUS_TRANSPORT_OPEN_BAD_ADDRESS; + } + + *transport_p = _dbus_transport_debug_pipe_new (name, error); + + if (*transport_p == NULL) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT; + } + else + { + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + return DBUS_TRANSPORT_OPEN_OK; + } + } + else + { + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + return DBUS_TRANSPORT_OPEN_NOT_HANDLED; + } +} + + /** @} */ #endif /* DBUS_BUILD_TESTS */ -- cgit