summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-server-debug-pipe.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2006-09-16 19:24:08 +0000
committerHavoc Pennington <hp@redhat.com>2006-09-16 19:24:08 +0000
commitfe4715b656237b89767b5dc0cba4c107541b6e0d (patch)
tree8defca3126803c37043110e7edb81dfa5476fceb /dbus/dbus-server-debug-pipe.c
parente001455a0300cc1df17684a028049c8c33e4f575 (diff)
2006-09-16 Havoc Pennington <hp@redhat.com>
* 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
Diffstat (limited to 'dbus/dbus-server-debug-pipe.c')
-rw-r--r--dbus/dbus-server-debug-pipe.c46
1 files changed, 44 insertions, 2 deletions
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 */