DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED /**< address is already used */
} DBusServerListenResult;
+DBusServerListenResult _dbus_server_listen_unix_socket (DBusAddressEntry *entry,
+ DBusServer **server_p,
+ DBusError *error);
+
DBusServerListenResult _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
DBusServer **server_p,
DBusError *error);
*/
/**
- * Tries to interpret the address entry in a platform-specific
- * way, creating a platform-specific server type if appropriate.
+ * Tries to interpret the address entry for UNIX socket
+ * addresses.
+ *
* Sets error if the result is not OK.
*
* @param entry an address entry
*
*/
DBusServerListenResult
-_dbus_server_listen_platform_specific (DBusAddressEntry *entry,
- DBusServer **server_p,
- DBusError *error)
+_dbus_server_listen_unix_socket (DBusAddressEntry *entry,
+ DBusServer **server_p,
+ DBusError *error)
{
const char *method;
return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
}
}
- else if (strcmp (method, "systemd") == 0)
+ else
+ {
+ /* If we don't handle the method, we return NULL with the
+ * error unset
+ */
+ _DBUS_ASSERT_ERROR_IS_CLEAR(error);
+ return DBUS_SERVER_LISTEN_NOT_HANDLED;
+ }
+}
+
+/**
+ * Tries to interpret the address entry in a platform-specific
+ * way, creating a platform-specific server type if appropriate.
+ * Sets error if the result is not OK.
+ *
+ * @param entry an address entry
+ * @param server_p location to store a new DBusServer, or #NULL on failure.
+ * @param error location to store rationale for failure on bad address
+ * @returns the outcome
+ *
+ */
+DBusServerListenResult
+_dbus_server_listen_platform_specific (DBusAddressEntry *entry,
+ DBusServer **server_p,
+ DBusError *error)
+{
+ const char *method;
+
+ *server_p = NULL;
+
+ method = dbus_address_entry_get_method (entry);
+ if (strcmp (method, "systemd") == 0)
{
int i, n;
DBusSocket *fds;
DBusError *error);
} listen_funcs[] = {
{ _dbus_server_listen_socket }
+#ifndef _WIN32 /* FIXME: remove in next commit */
+ , { _dbus_server_listen_unix_socket }
+#endif
, { _dbus_server_listen_platform_specific }
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
, { _dbus_server_listen_debug_pipe }