/*
* answer.c -- manipulating query answers and encoding them.
*
* Copyright (c) 2001-2006, NLnet Labs. All rights reserved.
*
* See LICENSE for the license.
*
*/
for (i = 0; !TC(q->packet) && i < answer->rrset_count; ++i) {
if (answer->section[i] == section) {
counts[section] += packet_encode_rrset(
q,
answer->domains[i],
answer->rrsets[i],
section, minimal_respsize, &done);
}
}
#ifdef MINIMAL_RESPONSES
/**
* done is set prematurely, because the minimal response size
* has been reached. No need to try adding RRsets in following
* sections.
*/
if (done) {
/* delegations should have a usable address in it */
if(section == ADDITIONAL_A_SECTION &&
counts[ADDITIONAL_A_SECTION] == 0 &&
q->delegation_domain)
TC_SET(q->packet);
break;
}
#endif
}