]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh: cleanup, removing unused Lua variables
authorPetr Špaček <petr.spacek@nic.cz>
Thu, 4 Apr 2019 11:33:04 +0000 (13: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 0299a67a3cf7e3a65321cc9d1c40d729e637266a..ea0d91cb70e041c972384bfe9115f22246e7aa58 100644 (file)
@@ -60,10 +60,9 @@ local function serve_doh(h, stream)
        -- Wait for the result of the query
        -- Note: We can't do non-blocking write to stream directly from resolve callbacks
        -- because they don't run inside cqueue.
-       local answers, authority = {}, {}
        local cond = condition.new()
        local waiting, done = false, false
-       local finish_cb = function (answer, req)
+       local finish_cb = function (answer, _)
                output_ttl = get_http_ttl(answer)
                -- binary output
                output = ffi.string(answer.wire, answer.size)
index 0e00b02b74f94778cb39872fbf40c88b9285d62d..edf48845279005e39b60f49a99d9b2a5038b5af3 100644 (file)
@@ -2,7 +2,6 @@ local basexx = require('basexx')
 local ffi = require('ffi')
 
 local function gen_huge_answer(_, req)
-       local qry = req:current()
        local answer = req.answer
        ffi.C.kr_pkt_make_auth_header(answer)
 
@@ -225,7 +224,7 @@ else
                req.headers:upsert(':method', 'POST')
                req:set_body(basexx.from_base64(  -- srcaddr.test.knot-resolver.cz TXT
                        'QNQBAAABAAAAAAAAB3NyY2FkZHIEdGVzdA1rbm90LXJlc29sdmVyAmN6AAAQAAE'))
-               local headers, pkt = check_ok(req, desc)
+               local _, pkt = check_ok(req, desc)
                same(pkt:rcode(), kres.rcode.REFUSED, desc .. ': view module caught it')
 
                modules.unload('view')
@@ -233,14 +232,13 @@ else
 
        -- RFC 8484 section 6 explicitly allows huge answers over HTTP
        local function test_huge_answer()
-               local triggered = false
                policy.add(policy.suffix(gen_huge_answer, policy.todnames({'huge.test'})))
                local desc = 'POST query for a huge answer'
                local req = req_templ:clone()
                req.headers:upsert(':method', 'POST')
                req:set_body(basexx.from_base64(  -- huge.test. URI, no EDNS
                        'HHwBAAABAAAAAAAABGh1Z2UEdGVzdAABAAAB'))
-               local headers, pkt = check_ok(req, desc)
+               local _, pkt = check_ok(req, desc)
                same(pkt:rcode(), kres.rcode.NOERROR, desc .. ': rcode NOERROR')
                same(pkt:tc(), false, desc .. ': no TC bit')
                same(pkt:ancount(), 2, desc .. ': ANSWER contains both RRs')