qu->answer->expires= -1;
qu->answer->nrrs= 0;
qu->answer->rrs.untyped= 0;
- qu->answer->rrsz= typei->rrsz;
+ qu->answer->rrsz= typei->getrrsz(typei,type);
return qu;
}
}
adns_status adns__internal_submit(adns_state ads, adns_query *query_r,
- const typeinfo *typei, vbuf *qumsg_vb,
- int id,
+ const typeinfo *typei, adns_rrtype type,
+ vbuf *qumsg_vb, int id,
adns_queryflags flags, struct timeval now,
qcontext *ctx) {
adns_query qu;
err= check_domain_name(ads, flags,ctx,typei, qumsg_vb->buf,qumsg_vb->used);
if (err) goto x_err;
- qu= query_alloc(ads,typei,typei->typekey,flags,now);
+ qu= query_alloc(ads,typei,type,flags,now);
if (!qu) { err = adns_s_nomemory; goto x_err; }
*query_r= qu;
adns_queryflags flags,
void *context,
adns_query *query_r) {
- if (type != adns_r_ptr && type != adns_r_ptr_raw) return EINVAL;
+ if (((type^adns_r_ptr) & adns_rrt_reprmask) &&
+ ((type^adns_r_ptr_raw) & adns_rrt_reprmask))
+ return EINVAL;
return adns_submit_reverse_any(ads,addr,"in-addr.arpa",
type,flags,context,query_r);
}
}
if (ans->nrrs && qu->typei->diff_needswap) {
- if (!adns__vbuf_ensure(&qu->vb,qu->typei->rrsz)) {
+ if (!adns__vbuf_ensure(&qu->vb,qu->answer->rrsz)) {
adns__query_fail(qu,adns_s_nomemory);
return;
}
qu->ads);
}
if (ans->nrrs && qu->typei->postsort) {
- qu->typei->postsort(qu->ads, ans->rrs.bytes, ans->nrrs, qu->typei);
+ qu->typei->postsort(qu->ads, ans->rrs.bytes,
+ ans->nrrs,ans->rrsz, qu->typei);
}
ans->expires= qu->expires;