Commit edbecf40 authored by Petr Špaček's avatar Petr Špaček

doh: polish timeouts

parent 91d35164
......@@ -20,7 +20,7 @@ local function serve_doh(h, stream)
local input
local method = h:get(':method')
if method == 'POST' then
input = stream:get_body_chars(65536, 10) -- FIXME: timeout
input = stream:get_body_chars(65536, 2) -- read timeout = KR_CONN_RTT_MAX
elseif method == 'GET' then
local input_b64 = string.match(h:get(':path'), '^/doh%?dns=([a-zA-Z0-9_-]+)$')
if not input_b64 then
......
......@@ -49,7 +49,7 @@ function parse_pkt(input, desc)
end
local function check_ok(req, desc)
local headers, stream, errno = req:go(5) -- TODO: randomly chosen timeout
local headers, stream, errno = req:go(8) -- randomly chosen timeout by tkrizek
if errno then
local errmsg = stream
nok(errmsg, desc .. ': ' .. errmsg)
......@@ -63,7 +63,7 @@ local function check_ok(req, desc)
end
local function check_err(req, exp_status, desc)
local headers, errmsg, errno = req:go(5) -- TODO: randomly chosen timeout
local headers, errmsg, errno = req:go(8) -- randomly chosen timeout by tkrizek
if errno then
nok(errmsg, desc .. ': ' .. errmsg)
return
......
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