From 9976821b5ca3de5025bae60c3eff5bcc78b6c454 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Tue, 8 Oct 2019 18:57:07 +0200 Subject: [PATCH] http: fix SO_REUSEPORT for HTTP sockets lua-cqueues.socket.fdopen() resets the reuseport flag, so binding Nth instance without systemd socket activation failed --- modules/http/http.lua.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/http/http.lua.in b/modules/http/http.lua.in index 0d07c4e66..4e6967cd8 100644 --- a/modules/http/http.lua.in +++ b/modules/http/http.lua.in @@ -278,7 +278,7 @@ local function add_socket(fd, kind, addr_str) assert(M.servers[fd] == nil, 'socket is already served by an HTTP instance') local conf = mergeconf(M.configs._builtin._all, M.configs._builtin[kind], M.configs._all, M.configs[kind]) - conf.socket = cqueues.socket.fdopen(fd) + conf.socket = cqueues.socket.fdopen({ fd = fd, reuseport = true, reuseaddr = true }) if conf.tls ~= false then -- Create a TLS context, either from files or new. if conf.ephemeral then if not M.ephem_state then -- 2.47.2