Commit 5a308fd2 authored by Petr Špaček's avatar Petr Špaček

doh: cleanup, removing unused Lua variables

parent 937a3ee0
......@@ -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)
......
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment