From 3b0eb45518b736e0d154e156843e62f2f829b052 Mon Sep 17 00:00:00 2001 From: Dmitry Potapov Date: Fri, 3 May 2024 19:24:34 +0300 Subject: [PATCH] http: server: _lws_vhost_init_server_af only needed once If we already have vh_listen_sockfd ready, call _lws_vhost_init_server_af only once, regardless of IPv6 support. --- lib/roles/http/server/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c index 53d45936f..1986ba0b2 100644 --- a/lib/roles/http/server/server.c +++ b/lib/roles/http/server/server.c @@ -458,6 +458,11 @@ _lws_vhost_init_server(const struct lws_context_creation_info *info, vhost->listen_port == CONTEXT_PORT_NO_LISTEN_SERVER) return 0; + if (info && info->vh_listen_sockfd) { + a.af = AF_UNSPEC; + goto single; + } + /* * Let's figure out what AF(s) we want this vhost to listen on. *