Skip to content
Snippets Groups Projects
Commit 65e8658c authored by Marek Vavruša's avatar Marek Vavruša
Browse files

lib: cleanup

parent 01ec28f4
No related branches found
No related tags found
No related merge requests found
......@@ -212,7 +212,7 @@ static int l_trampoline(lua_State *L)
return 0;
}
JsonNode *root_node = json_decode(ret);
if (root_node->tag == JSON_OBJECT || root_node->tag == JSON_ARRAY) {
if (root_node && (root_node->tag == JSON_OBJECT || root_node->tag == JSON_ARRAY)) {
l_unpack_json(L, root_node);
} else {
lua_pushstring(L, ret);
......
......@@ -46,9 +46,10 @@ setmetatable(modules, {
if not rawget(_G, k) then
modules.load(k)
local mod = _G[k]
if mod and mod['config'] then
if k ~= v then mod['config'](v)
else mod['config']()
local config = rawget(mod, 'config')
if mod and config then
if k ~= v then config(v)
else config()
end
end
end
......
......@@ -333,7 +333,7 @@ int kr_cache_peek_rrsig(struct kr_cache_txn *txn, knot_rrset_t *rr, uint32_t *ti
/* Check if the RRSet is in the cache. */
struct kr_cache_entry *entry = NULL;
int ret = kr_cache_peek(txn, KR_CACHE_RRSIG, rr->owner, rr->type, &entry, timestamp);
int ret = kr_cache_peek(txn, KR_CACHE_SIG, rr->owner, rr->type, &entry, timestamp);
if (ret != 0) {
return ret;
}
......@@ -368,5 +368,5 @@ int kr_cache_insert_rrsig(struct kr_cache_txn *txn, const knot_rrset_t *rr, uint
}
namedb_val_t data = { rr->rrs.data, knot_rdataset_size(&rr->rrs) };
return kr_cache_insert(txn, KR_CACHE_RRSIG, rr->owner, typec, &header, data);
return kr_cache_insert(txn, KR_CACHE_SIG, rr->owner, typec, &header, data);
}
......@@ -24,7 +24,7 @@ enum kr_cache_tag {
KR_CACHE_RR = 'R',
KR_CACHE_PKT = 'P',
KR_CACHE_SEC = 'S',
KR_CACHE_RRSIG = 'G',
KR_CACHE_SIG = 'G',
KR_CACHE_USER = 0x80
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment