From 4ee74fa7082a1a521dc5f7a4b61a62b61d1480b2 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 3 Feb 2017 12:06:44 +0000 Subject: ui: refactor VncDisplay to allow multiple listening sockets Currently there is only a single listener for plain VNC and a single listener for websockets VNC. This means that if getaddrinfo() returns multiple IP addresses, for a hostname, the VNC server can only listen on one of them. This is just bearable if listening on wildcard interface, or if the host only has a single network interface to listen on, but if there are multiple NICs and the VNC server needs to listen on 2 or more specific IP addresses, it can't be done. This refactors the VncDisplay state so that it holds an array of listening sockets, but still only listens on one socket. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange Message-id: 20170203120649.15637-4-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/vnc.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ui/vnc.h') diff --git a/ui/vnc.h b/ui/vnc.h index d8c9de5a75..694cf32ca9 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -146,10 +146,12 @@ struct VncDisplay int num_exclusive; int connections_limit; VncSharePolicy share_policy; - QIOChannelSocket *lsock; - guint lsock_tag; - QIOChannelSocket *lwebsock; - guint lwebsock_tag; + size_t nlsock; + QIOChannelSocket **lsock; + guint *lsock_tag; + size_t nlwebsock; + QIOChannelSocket **lwebsock; + guint *lwebsock_tag; DisplaySurface *ds; DisplayChangeListener dcl; kbd_layout_t *kbd_layout; -- cgit v1.2.3