Commit 0e6bf33b authored by Vitezslav Kriz's avatar Vitezslav Kriz

zone-size-limit: cleanup

parent 4dc04dc6
......@@ -363,6 +363,7 @@ static int axfr_answer_finalize(struct answer_data *adata)
static int axfr_answer_packet(knot_pkt_t *pkt, struct answer_data *adata)
{
assert(adata != NULL);
struct xfr_proc *proc = adata->ext;
assert(pkt != NULL);
assert(proc != NULL);
......@@ -383,8 +384,7 @@ static int axfr_answer_packet(knot_pkt_t *pkt, struct answer_data *adata)
for (uint16_t i = 0; i < answer->count; ++i) {
if (answer_rr[i].type == KNOT_RRTYPE_SOA &&
node_rrtype_exists(zc.z->apex, KNOT_RRTYPE_SOA)) {
log_zone_debug(proc->contents->apex->owner, "size: %zu", proc->contents->size);
return KNOT_STATE_DONE;
return KNOT_STATE_DONE;
} else {
int ret = zcreator_step(&zc, &answer_rr[i]);
if (ret != KNOT_EOK) {
......
......@@ -25,7 +25,6 @@
#pragma once
#include "libknot/packet/pkt.h"
#include "knot/conf/conf.h"
#include "knot/nameserver/log.h"
#include "knot/query/query.h"
#include "knot/nameserver/process_query.h"
......
......@@ -352,7 +352,6 @@ static int ixfrin_answer_init(struct answer_data *data)
if (proc == NULL) {
return KNOT_ENOMEM;
}
memset(proc, 0, sizeof(struct ixfr_proc));
gettimeofday(&proc->proc.tstamp, NULL);
......
......@@ -169,6 +169,12 @@ static const struct check_function CHECK_FUNCTIONS[] = {
static const int CHECK_FUNCTIONS_LEN = sizeof(CHECK_FUNCTIONS)
/ sizeof(struct check_function);
/*!
* \biref Measure size of zone
*
* Not actual semantic check, but measure size of zone.
* Zone size is saved into zone_contents structure.
*/
static int measure_size(const zone_node_t *node, semchecks_data_t *data){
int rrset_count = node->rrset_count;
......@@ -180,7 +186,6 @@ static int measure_size(const zone_node_t *node, semchecks_data_t *data){
return KNOT_EOK;
}
/*!
* \brief Check whether DNSKEY rdata are valid.
*
......@@ -953,8 +958,6 @@ int zone_do_sem_checks(zone_contents_t *zone, bool optional,
int ret = zone_contents_tree_apply_inorder(zone, do_checks_in_tree,
&data);
log_zone_debug(zone->apex->owner, "semcheck: size of zone: %zu", zone->size);
if (ret != KNOT_EOK) {
return ret;
}
......
......@@ -268,6 +268,7 @@ size_t knot_rrset_size(const knot_rrset_t *rrset)
for (size_t i = 0; i < rr_count; ++i) {
const knot_rdata_t *rr = knot_rdataset_at(&rrset->rrs, i);
assert(rr);
/* 10B = TYPE + CLASS + TTL + RDLENGTH */
total_size += knot_rdata_rdlen(rr) + 10;
}
......
......@@ -194,6 +194,11 @@ bool knot_rrset_is_nsec3rel(const knot_rrset_t *rr);
*/
int knot_rrset_rr_to_canonical(knot_rrset_t *rrset);
/*!
* \brief Size of rrset in wire format.
*
* \retval size in bytes
*/
size_t knot_rrset_size(const knot_rrset_t *rrset);
/*! @} */
......@@ -37,6 +37,4 @@ resp = slave.dig("test.example.com.", "TXT")
resp.check("passed")
#t.xfr_diff(master, slave, zone)
t.end()
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