00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <config.h>
00026 #include "dbus-internals.h"
00027 #include "dbus-server-win.h"
00028 #include "dbus-server-socket.h"
00029
00049 DBusServerListenResult
00050 _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
00051 DBusServer **server_p,
00052 DBusError *error)
00053 {
00054 const char *method;
00055
00056 *server_p = NULL;
00057
00058 method = dbus_address_entry_get_method (entry);
00059
00060 if (strcmp (method, "autolaunch") == 0)
00061 {
00062 const char *host = "localhost";
00063 const char *bind = "localhost";
00064 const char *port = "0";
00065 const char *family = "ipv4";
00066 const char *scope = dbus_address_entry_get_value (entry, "scope");
00067
00068 if (_dbus_daemon_is_session_bus_address_published (scope))
00069 return DBUS_SERVER_LISTEN_ADDRESS_ALREADY_USED;
00070
00071 *server_p = _dbus_server_new_for_tcp_socket (host, bind, port,
00072 family, error, FALSE);
00073 if (*server_p)
00074 {
00075 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
00076 (*server_p)->published_address =
00077 _dbus_daemon_publish_session_bus_address ((*server_p)->address, scope);
00078 return DBUS_SERVER_LISTEN_OK;
00079 }
00080 else
00081 {
00082
00083 _dbus_daemon_unpublish_session_bus_address ();
00084 _DBUS_ASSERT_ERROR_IS_SET(error);
00085 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
00086 }
00087 }
00088 else
00089 {
00090 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
00091 return DBUS_SERVER_LISTEN_NOT_HANDLED;
00092 }
00093 }
00094