From: Vladimír Čunát Date: Wed, 14 Aug 2019 15:16:58 +0000 (+0200) Subject: modules/ta_signal_query: optimize X-Git-Tag: v4.3.0~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0e76c9dd2a6d8764d1ba927c8f94cc580f0f7fd;p=thirdparty%2Fknot-resolver.git modules/ta_signal_query: optimize Basically the same as the parent commit (just much simpler). --- diff --git a/modules/ta_signal_query/ta_signal_query.lua b/modules/ta_signal_query/ta_signal_query.lua index d1945c7e7..081d7982d 100644 --- a/modules/ta_signal_query/ta_signal_query.lua +++ b/modules/ta_signal_query/ta_signal_query.lua @@ -50,10 +50,13 @@ local function send_ta_query(domain) end -- act on DNSKEY queries which were not answered from cache -function M.layer.consume(state, req, _) - local qry = req:current() - if qry.stype == kres.type.DNSKEY and not qry.flags.CACHED then - send_ta_query(qry:name()) +function M.layer.consume(state, req, pkt) + -- First check for standard "cached packets": PKT_SIZE_NOWIRE, for efficiency. + if pkt.size ~= -1 and pkt:qtype() == kres.type.DNSKEY then + local qry = req:current() + if not qry.flags.CACHED then + send_ta_query(qry:name()) + end end return state -- do not interfere with normal query processing end