Commit 18adc1e9 authored by Petr Špaček's avatar Petr Špaček

Merge branch 'http_reuseport' into 'master'

http: fix SO_REUSEPORT for HTTP sockets

See merge request !879
parents 9fa9df98 b4f32c2f
Pipeline #53965 failed with stages
in 18 minutes and 40 seconds
Knot Resolver ??
================================
Bugfixes
--------
- http module: use SO_REUSEPORT (!879)
Improvements
------------
- increase file-descriptor count limit to maximum allowed value (hard limit)
- watchdog module: support testing a DNS query (and switch C -> lua; !878)
Knot Resolver 4.2.2 (2019-10-07)
......
......@@ -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
......
......@@ -20,7 +20,7 @@ else
local bound
for _ = 1,1000 do
bound = net.listen('127.0.0.1', math.random(1025,65535), { kind = 'webtest'} )
bound = net.listen('127.0.0.1', math.random(20000, 29999), { kind = 'webtest'} )
if bound then
break
end
......
......@@ -88,7 +88,7 @@ else
local bound
for _ = 1,1000 do
bound = net.listen('127.0.0.1', math.random(1025,65535), { kind = 'doh'} )
bound = net.listen('127.0.0.1', math.random(30000, 39999), { kind = 'doh'} )
if bound then
break
end
......
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