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
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)
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