[Spice-devel] [PATCHv2 05/10] session: connect to UNIX path

Christophe Fergeau cfergeau at redhat.com
Tue Jan 27 07:48:39 PST 2015


On Tue, Jan 27, 2015 at 02:53:18PM +0100, Marc-André Lureau wrote:
> ---
>  gtk/spice-session.c | 46 +++++++++++++++++++++++++++++++---------------
>  1 file changed, 31 insertions(+), 15 deletions(-)
> 
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 98708c8..03e0618 100644
> --- a/gtk/spice-session.c
> +++ b/gtk/spice-session.c
> @@ -19,7 +19,9 @@
>  
>  #include <gio/gio.h>
>  #include <glib.h>
> -
> +#ifdef G_OS_UNIX
> +#include <gio/gunixsocketaddress.h>
> +#endif
>  #include "common/ring.h"
>  
>  #include "spice-client.h"
> @@ -1980,21 +1982,28 @@ static gboolean open_host_idle_cb(gpointer data)
>          return FALSE;
>      }
>  
> -    if (open_host->proxy)
> +    if (open_host->proxy) {
>          g_resolver_lookup_by_name_async(g_resolver_get_default(),
>                                          spice_uri_get_hostname(open_host->proxy),
>                                          open_host->cancellable,
>                                          proxy_lookup_ready, open_host);
> -    else
> -    {
> +    } else {
>          GSocketConnectable *address;
>  
> -        address = g_network_address_new(s->host, open_host->port);
> +#ifdef G_OS_UNIX
> +        if (s->unix_path) {
> +            SPICE_DEBUG("open unix path %s", s->unix_path);
> +            address = G_SOCKET_CONNECTABLE(g_unix_socket_address_new(s->unix_path));
> +        } else
> +#endif

Maybe something like this?

        if (s->unix_path) {
#ifdef G_OS_UNIX
            SPICE_DEBUG("open unix path %s", s->unix_path);
            address = G_SOCKET_CONNECTABLE(g_unix_socket_address_new(s->unix_path));
#else
            g_warning("Unix path unsupported on this platform");
            /* set open_host->error */
#endif
        } else
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150127/f949ed39/attachment.sig>


More information about the Spice-devel mailing list