]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache: changed get_new_ttl private API to allow custom timestamp
authorMarek Vavruša <marek@vavrusa.com>
Wed, 14 Mar 2018 19:10:46 +0000 (12:10 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
Before the API depended on the qry object which only makes sense during
resolution of requests, not when manipulating cache out of it.

lib/cache/api.c
lib/cache/impl.h

index 1c8bf977b2783d88751d81708492a618bad666de..6c28d7cfacfcf7febd903c3f4beaa35b3d5837f3 100644 (file)
@@ -705,6 +705,7 @@ static int stash_nsec_p(const knot_dname_t *dname, const char *nsec_p_v,
                VERBOSE_MSG(qry, "=> EL write failed (ret: %d)\n", ret);
                return kr_ok();
        }
+
        if (log_refresh_by) {
                VERBOSE_MSG(qry, "=> nsec_p stashed for %s (refresh by %d, hash: %x)\n",
                                log_dname, log_refresh_by, log_hash);
@@ -870,4 +871,3 @@ cleanup:
        }
        return ret;
 }
-
index c56cb35df1039521aa6ec8aa170f00eeedd0a7ac..c38ac6c5b2bdd66f866b448a19ac379a730f7ae5 100644 (file)
@@ -248,8 +248,6 @@ static inline int entry_list_serial_size(const entry_list_t list)
  */
 void entry_list_memcpy(struct entry_apex *ea, entry_list_t list);
 
-
-
 /* Packet caching; implementation in ./entry_pkt.c */
 
 /** Stash the packet into cache (if suitable, etc.)
@@ -282,7 +280,6 @@ static inline bool is_expiring(uint32_t orig_ttl, uint32_t new_ttl)
 int32_t get_new_ttl(const struct entry_h *entry, const struct kr_query *qry,
                     const knot_dname_t *owner, uint16_t type, uint32_t now);
 
-
 /* RRset (de)materialization; implementation in ./entry_rr.c */
 
 /** Size of the RR count field */