qstate->ext_state[i] = module_state_initial;
}
+/** recursive debug logging of (sub)query structure */
+static void
+run_debug(struct module_qstate* p, int d)
+{
+ char buf[80+1+1]; /* max nn=80; marker is 1, zero at end is 1 */
+ int i, nn = d*2;
+ if(nn > 80)
+ nn = 80;
+ for(i=0; i<nn; i++) {
+ buf[i] = ' ';
+ }
+ buf[i++] = 'o';
+ buf[i] = 0;
+ log_nametypeclass(buf, p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
+ for(p = p->subquery_first; p; p = p->subquery_next) {
+ run_debug(p, d+1);
+ }
+}
+
/** find runnable recursive */
static struct module_qstate*
find_run_in(struct module_qstate* p)
{
struct module_qstate* q;
- log_nametypeclass("find run in", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
for(p = p->subquery_first; p; p = p->subquery_next) {
- log_nametypeclass("find run passed", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
if(p->ext_state[p->curmod] == module_state_initial)
return p;
- log_nametypeclass("find run morepass", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
if((q=find_run_in(p)))
return q;
}
return p->subquery_next;
while(p->parent)
p = p->parent;
+ if(verbosity >= VERB_ALGO)
+ run_debug(p, 0);
return find_run_in(p);
}
7 June 2007: Wouter
- fixup error in double linked list insertion for subqueries and
for outbound list of serviced queries for iterator module.
- - nicer printout of outgoing port selection.
+ - nicer printout of outgoing port selection.
+ - fixup cname target readout.
+ - nicer debug output.
5 June 2007: Wouter
- iterator state finished.
* it is relevant. */
if(ntohs(s->rk.type) == LDNS_RR_TYPE_CNAME &&
query_dname_compare(mname, s->rk.dname) == 0) {
+ log_nametypeclass("following CNAME from", mname, LDNS_RR_TYPE_CNAME, request->qclass);
get_cname_target(s, &mname, &mname_len);
+ log_nametypeclass("following CNAME to", mname, request->qtype, request->qclass);
}
}
/* if we encountered a CNAME (or a bunch of CNAMEs), and
memcpy(&key.addr, &reply_info->addr, reply_info->addrlen);
key.addrlen = reply_info->addrlen;
verbose(VERB_ALGO, "Incoming reply id=%4.4x addr=", key.id);
+ if(verbosity >= VERB_ALGO) {
+ log_addr("Incoming reply addr=", &reply_info->addr, reply_info->addrlen);
+ }
/* find it, see if this thing is a valid query response */
verbose(VERB_ALGO, "lookup size is %d entries", (int)outnet->pending->count);
p = (struct pending*)rbtree_search(outnet->pending, &key);
if(!p) {
- verbose(VERB_DETAIL, "received unsolicited udp reply. dropped.");
+ verbose(VERB_DETAIL, "received unwanted or unsolicited udp reply dropped.");
return 0;
}
len = ldns_read_uint16(d->rr_data[0]);
if(len != d->rr_len[0] - sizeof(uint16_t))
return;
- len -= sizeof(uint16_t);
if(dname_valid(d->rr_data[0]+sizeof(uint16_t), len) != len)
return;
*dname = d->rr_data[0]+sizeof(uint16_t);