Commit 9976821b authored by Petr Špaček's avatar Petr Špaček

http: fix SO_REUSEPORT for HTTP sockets

lua-cqueues.socket.fdopen() resets the reuseport flag, so binding Nth
instance without systemd socket activation failed
parent 9fa9df98
Pipeline #53891 failed with stages
in 19 minutes and 29 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment