Commit 550ceca4 authored by Marek Vavrusa's avatar Marek Vavrusa

lib: sync before clearing, cleanup

parent 23708ddb
......@@ -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;
}
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment