From: Petr Špaček Date: Wed, 3 Apr 2019 14:33:13 +0000 (+0200) Subject: doh: polish timeouts X-Git-Tag: v4.0.0~10^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edbecf40636a43244dc197e7ff4a4f4f906523d3;p=thirdparty%2Fknot-resolver.git doh: polish timeouts --- diff --git a/modules/http/http_doh.lua b/modules/http/http_doh.lua index 5768cf821..d5d67a085 100644 --- a/modules/http/http_doh.lua +++ b/modules/http/http_doh.lua @@ -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 diff --git a/modules/http/http_doh.test.lua b/modules/http/http_doh.test.lua index cc9d9be2d..88e7f8644 100644 --- a/modules/http/http_doh.test.lua +++ b/modules/http/http_doh.test.lua @@ -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