]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib: sync before clearing, cleanup
authorMarek Vavrusa <marek@vavrusa.com>
Sun, 29 May 2016 20:27:57 +0000 (13:27 -0700)
committerMarek Vavrusa <marek@vavrusa.com>
Sun, 29 May 2016 20:27:57 +0000 (13:27 -0700)
lib/cache.c
lib/cdb_lmdb.c
lib/layer/rrcache.c
lib/zonecut.c
scripts/bootstrap-depends.sh

index 8fe7939fde5e5fd4ba59577d0c07b173f4bd86ca..f6ab4b12f5ca31d30e241b7b5c24890b28451a83 100644 (file)
@@ -73,7 +73,7 @@ static int assert_right_version(struct kr_cache *cache)
                        ret = cache_op(cache, write, &key, &val, 1);
                }
        }
-       cache_op(cache, sync);
+       kr_cache_sync(cache);
        return ret;
 }
 
index a6257085f36e8a71236b8dcba805ba0a21e71fb0..8fc14decaeae226170b1deaf4dd3926cc21b5079 100644 (file)
@@ -261,6 +261,8 @@ static int cdb_count(knot_db_t *db)
 static int cdb_clear(knot_db_t *db)
 {
        struct lmdb_env *env = db;
+       /* Always attempt to commit write transactions in-flight. */
+       (void) cdb_sync(db);
 
        /* Since there is no guarantee that there will be free
         * pages to hold whole dirtied db for transaction-safe clear,
index bce801e019e8d9fa74228cfea44b8bdc572822aa..b86a2918247bb80a70f945fed1675a0c1a2d23e5 100644 (file)
@@ -205,8 +205,6 @@ static int commit_rr(const char *key, void *val, void *data)
                }
        }
 
-       knot_rrset_t query_rr;
-       knot_rrset_init(&query_rr, rr->owner, rr->type, rr->rclass);
        uint8_t flags = KR_CACHE_FLAG_NONE;
        if ((rank & KR_RANK_AUTH) && (baton->qry->flags & QUERY_DNSSEC_WEXPAND)) {
                flags |= KR_CACHE_FLAG_WCARD_PROOF;
index 2293a47334761a9dba43099c541ce2ebaefa0af2..2aec10366f48db8ef0b171e18e8ce9f67c82e007 100644 (file)
@@ -411,11 +411,11 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const
        }
        /* Copy name as it may overlap with cut name that is to be replaced. */
        knot_dname_t *qname = knot_dname_copy(name, cut->pool);
-       const knot_dname_t *label = qname;
-       if (!label) {
+       if (!qname) {
                return kr_error(ENOMEM);
        }
        /* Start at QNAME parent. */
+       const knot_dname_t *label = qname;
        while (true) {
                /* Fetch NS first and see if it's insecure. */
                uint8_t rank = 0;
index 25f92c0dc42409ad1cd19b9cd9d9332f118cc804..970f61b346a23da8058b9668cbb5e190ce9fffc9 100755 (executable)
@@ -15,7 +15,7 @@ NETTLE_TAG="2.7.1"
 NETTLE_URL="https://ftp.gnu.org/gnu/nettle/nettle-${NETTLE_TAG}.tar.gz"
 GNUTLS_TAG="3.3.12"
 GNUTLS_URL="ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-${GNUTLS_TAG}.tar.xz"
-LUA_TAG="v2.1.0-beta1"
+LUA_TAG="v2.1.0-beta2"
 LUA_URL="https://github.com/LuaJIT/LuaJIT.git"
 HIREDIS_TAG="v0.13.3"
 HIREDIS_URL="https://github.com/redis/hiredis.git"