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 */
memset(slot, 0, lru->stride);
slot->key = malloc(len);
if (!slot->key) {
- slot->len = 0;
return NULL;
}
memcpy(slot->key, key, len);
/* 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;
}
update_cut_name(cut, name);
return kr_ok();
}
- if (!name || !name[0]) {
+ if (name[0] == '\0') {
break;
}
/* Subtract label from QNAME. */