]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
fixup! WIP: DoH experiment
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 29 Mar 2019 19:46:36 +0000 (20:46 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:47 +0000 (09:12 +0200)
daemon/lua/kres-gen.lua
daemon/lua/kres-gen.sh
modules/http/http_doh.lua

index 9d8d970bb4f50280f571c1c00cf68280b58b3186..c369c6499eea6b51e3272f10467d558bb451d7c8 100644 (file)
@@ -345,6 +345,7 @@ int kr_cache_insert_rr(struct kr_cache *, const knot_rrset_t *, const knot_rrset
 int kr_cache_remove(struct kr_cache *, const knot_dname_t *, uint16_t);
 int kr_cache_remove_subtree(struct kr_cache *, const knot_dname_t *, _Bool, int);
 int kr_cache_commit(struct kr_cache *);
+uint32_t packet_ttl(const knot_pkt_t *, _Bool);
 typedef struct {
        uint8_t bitmap[32];
        uint8_t length;
@@ -440,5 +441,4 @@ int zs_parse_record(zs_scanner_t *);
 int zs_set_input_file(zs_scanner_t *, const char *);
 int zs_set_input_string(zs_scanner_t *, const char *, size_t);
 const char *zs_strerror(const int);
-uint32_t packet_ttl(const knot_pkt_t *pkt, bool is_negative);
 ]]
index 1f626beb1194c2c346bab5b91b553eb393ce5684..83d46c06959de7d0761218441e4ce520d8f39717 100755 (executable)
@@ -210,6 +210,8 @@ ${CDEFS} ${LIBKRES} functions <<-EOF
        kr_cache_remove
        kr_cache_remove_subtree
        kr_cache_commit
+       # FIXME: perhaps rename this exported symbol
+       packet_ttl
 EOF
 
 
index 705505721e590a1d61cf327832a50e9788ce8d1a..9c7b71b0544f63d7079ce5e632dc2833dbdd8f33 100644 (file)
@@ -6,7 +6,6 @@ local function get_http_ttl(pkt)
        if true then
                local an_records = pkt:section(kres.section.ANSWER)
                local is_negative = #an_records <= 0
-               -- FIXME: does not work for positive answers
                return ffi.C.packet_ttl(pkt, is_negative)
        end
 
@@ -61,7 +60,7 @@ local function serve_doh(h, stream)
        end
 
        -- Resolve query
-       wire = ffi.cast("void *", input)
+       local wire = ffi.cast("void *", input)
        local pkt = ffi.C.knot_pkt_new(wire, #input, nil);
        if not pkt then
                output = 'shit happened in knot_pkt_new'