]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh: polish timeouts
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 3 Apr 2019 14:33:13 +0000 (16:33 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:49 +0000 (09:12 +0200)
modules/http/http_doh.lua
modules/http/http_doh.test.lua

index 5768cf8217e3bdad219a27dafc032c5d17dd92e0..d5d67a08550a1f3a2e44ee674dce3421eaa31d4e 100644 (file)
@@ -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
index cc9d9be2da213acd5311fa748e2ed1ed12cc8da1..88e7f864474598bd85e37f172c26a2598dbc6e5f 100644 (file)
@@ -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