Commit 9b600e68 authored by Marek Vavruša's avatar Marek Vavruša

lib: cleanup

parent 80e850be
......@@ -73,7 +73,7 @@ static struct qr_task *qr_task_create(struct worker_ctx *worker, uv_handle_t *ha
pool.ctx = array_tail(worker->pools);
array_pop(worker->pools);
} else { /* No mempool on the freelist, create new one */
pool.ctx = mp_new (KNOT_WIRE_MAX_PKTSIZE);
pool.ctx = mp_new (16 * CPU_PAGE_SIZE);
}
/* Create worker task */
......
......@@ -139,7 +139,6 @@ static inline void *lru_slot_set(struct lru_hash_base *lru, const char *key, uin
memset(slot, 0, lru->stride);
slot->key = malloc(len);
if (!slot->key) {
slot->len = 0;
return NULL;
}
memcpy(slot->key, key, len);
......
......@@ -57,7 +57,7 @@ static const knot_dname_t *minimized_qname(struct kr_query *query, uint16_t *qty
/* Minimize name to contain current zone cut + 1 label. */
int cut_labels = knot_dname_labels(query->zone_cut.name, NULL);
int qname_labels = knot_dname_labels(qname, NULL);
while(qname_labels > cut_labels + 1) {
while(qname[0] && qname_labels > cut_labels + 1) {
qname = knot_wire_next_label(qname, NULL);
qname_labels -= 1;
}
......
......@@ -261,7 +261,7 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const
update_cut_name(cut, name);
return kr_ok();
}
if (!name || !name[0]) {
if (name[0] == '\0') {
break;
}
/* Subtract label from QNAME. */
......
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