Commit 45e1e7cb authored by Petr Špaček's avatar Petr Špaček

http: remember server config in http.servers table

parent b6d0e8ce
......@@ -366,7 +366,7 @@ function M.add_interface(conf)
if err then
panic('failed to listen on %s: %s', addr_str, err)
end
table.insert(M.servers, s)
table.insert(M.servers, {server = s, config = conf})
-- Create certificate renewal timer if ephemeral
if crt and ephemeral then
local _, expiry = crt:getLifetime()
......@@ -401,7 +401,7 @@ end
-- @function Cleanup module
function M.deinit()
for i, server in ipairs(M.servers) do
server:close()
server.server:close()
M.servers[i] = nil
end
prometheus.deinit()
......
......@@ -14,12 +14,12 @@ else
modules = {
http = {
port = 0, -- Select random port
cert = false,
tls = false,
endpoints = endpoints,
}
}
local server = http.servers[1]
local server = http.servers[1].server
ok(server ~= nil, 'creates server instance')
local _, host, port = server:localname()
ok(host and port, 'binds to an interface')
......
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