From: Petr Špaček Date: Thu, 4 Apr 2019 11:33:04 +0000 (+0200) Subject: doh: cleanup, removing unused Lua variables X-Git-Tag: v4.0.0~10^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a308fd2add87d826af8a262791ecd62a20620e2;p=thirdparty%2Fknot-resolver.git doh: cleanup, removing unused Lua variables --- diff --git a/modules/http/http_doh.lua b/modules/http/http_doh.lua index 0299a67a3..ea0d91cb7 100644 --- a/modules/http/http_doh.lua +++ b/modules/http/http_doh.lua @@ -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) diff --git a/modules/http/http_doh.test.lua b/modules/http/http_doh.test.lua index 0e00b02b7..edf488452 100644 --- a/modules/http/http_doh.test.lua +++ b/modules/http/http_doh.test.lua @@ -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')