]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
minor cleanups, reduce verbosity
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 10 Nov 2017 16:52:17 +0000 (17:52 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 10 Nov 2017 16:55:10 +0000 (17:55 +0100)
lib/cache.c
lib/cache/entry_rr.c
lib/cache/impl.h

index fae5609347423923eddde00a0386ba5c82d05755..ce406e86d814c910019f76afaebe080fc6b6d5d7 100644 (file)
@@ -208,7 +208,7 @@ int32_t get_new_ttl(const struct entry_h *entry, uint32_t current_time)
                diff = 0;
        }
        int32_t res = entry->ttl - diff;
-       VERBOSE_MSG(NULL, "TTL remains: %d\n", (int)res);
+       //VERBOSE_MSG(NULL, "TTL remains: %d\n", (int)res);
        return res;
 }
 int32_t kr_cache_ttl(const struct kr_cache_p *peek, uint32_t current_time)
@@ -219,12 +219,6 @@ int32_t kr_cache_ttl(const struct kr_cache_p *peek, uint32_t current_time)
 
 
 
-/* forwards for larger chunks of code */
-
-static uint8_t get_lowest_rank(const struct kr_request *req, const struct kr_query *qry);
-static int found_exact_hit(kr_layer_t *ctx, knot_pkt_t *pkt, knot_db_val_t val,
-                          uint8_t lowest_rank);
-static knot_db_val_t closest_NS(kr_layer_t *ctx, struct key *k);
 
 
 
@@ -264,7 +258,7 @@ knot_db_val_t key_exact_type_maypkt(struct key *k, uint16_t type)
        return (knot_db_val_t){ k->buf + 1, name_len + 4 };
 }
 
-/** TODO */
+/** Like key_exact_type_maypkt but with extra checks if used for RRs only. */
 static knot_db_val_t key_exact_type(struct key *k, uint16_t type)
 {
        switch (type) {
@@ -489,6 +483,11 @@ static int dname_wire_reconstruct(knot_dname_t *buf, const struct key *k,
 }
 
 
+/* Forwards for larger chunks of code.  All just for cache_lmbd_peek. */
+static uint8_t get_lowest_rank(const struct kr_request *req, const struct kr_query *qry);
+static int found_exact_hit(kr_layer_t *ctx, knot_pkt_t *pkt, knot_db_val_t val,
+                          uint8_t lowest_rank);
+static knot_db_val_t closest_NS(kr_layer_t *ctx, struct key *k);
 static int answer_simple_hit(kr_layer_t *ctx, knot_pkt_t *pkt, uint16_t type,
                const struct entry_h *eh, const void *eh_bound, uint32_t new_ttl);
 
index ed8dfc6a2dc6b10ed8bd7b89c7ba33360d5246a8..c44751eb420f7df2616e4504328791b217345cd9 100644 (file)
@@ -83,7 +83,7 @@ static int rdataset_materialize(knot_rdataset_t * restrict rds, const void *data
                //d_out = kr_rdataset_next(d_out);
                d_out += 4 + 2 + len; /* TTL + rdlen + rdata */
        }
-       VERBOSE_MSG(NULL, "materialized from %d B\n", (int)(d - data));
+       //VERBOSE_MSG(NULL, "materialized from %d B\n", (int)(d - data));
        return d - data;
 }
 
index 9c08c09c627edb94f6a8dc8d0f608cb072da27c1..27ec2fda68c2f3af35c217cbaacf42f70bc707f2 100644 (file)
@@ -80,7 +80,9 @@ static inline size_t key_nwz_off(const struct key *k)
        return k->zlf_len + 2;
 }
 
-
+/** Finish constructing string key for for exact search.
+ * It's assumed that kr_dname_lf(k->buf, owner, NULL) had been ran.
+ */
 knot_db_val_t key_exact_type_maypkt(struct key *k, uint16_t type);