[Spice-devel] [PATCH spice-gtk 5/9] session: connect to UNIX path
Christophe Fergeau
cfergeau at redhat.com
Mon Jan 26 09:38:41 PST 2015
On Tue, Jan 13, 2015 at 05:38:24PM +0100, Marc-André Lureau wrote:
> ---
> gtk/spice-session.c | 43 ++++++++++++++++++++++++++++---------------
> 1 file changed, 28 insertions(+), 15 deletions(-)
>
> diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> index 83d8568..6f04a1a 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"
> @@ -1972,21 +1974,25 @@ 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);
> + if (s->unix_path) {
> + SPICE_DEBUG("open path %s", s->unix_path);
slight preference for the more verbose "open unix path" here
> + address = G_SOCKET_CONNECTABLE(g_unix_socket_address_new(s->unix_path));
You need to protect this with G_OS_UNIX too.
Looks good otherwise.
Christophe
-------------- 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/20150126/137ce42e/attachment.sig>
More information about the Spice-devel
mailing list