aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/vnc.c')
-rw-r--r--ui/vnc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index f2701e5974..b0889b10b6 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3558,7 +3558,13 @@ void vnc_display_open(const char *id, Error **errp)
wsaddr->type = SOCKET_ADDRESS_KIND_INET;
inet = wsaddr->u.inet.data = g_new0(InetSocketAddress, 1);
inet->host = g_strdup(saddr->u.inet.data->host);
- inet->port = g_strdup(websocket);
+ if (g_str_equal(websocket, "") ||
+ g_str_equal(websocket, "on")) {
+ inet->port = g_strdup_printf(
+ "%d", (int)baseport + 5700);
+ } else {
+ inet->port = g_strdup(websocket);
+ }
if (to) {
inet->has_to = true;