+ if (ll == *ll_io) return adns_s_querydomaininvalid;
+ label_r[ll++]= c;
+ }
+
+ *p_io= p;
+ *ll_io= ll;
+ return adns_s_ok;
+}
+
+adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
+ const char *owner, int ol,
+ const typeinfo *typei, adns_rrtype type,
+ adns_queryflags flags) {
+ int ll, nbytes;
+ byte label[255];
+ byte *rqp;
+ const char *p, *pe;
+ adns_status st;
+
+ if (!((type^adns_r_addr) & adns_rrt_reprmask)) ads->nextid++;
+ st= mkquery_header(ads,vb,id_r,ol+2); if (st) return st;
+
+ MKQUERY_START(vb);
+
+ p= owner; pe= owner+ol;
+ nbytes= 0;
+ while (p!=pe) {
+ ll= sizeof(label);
+ st= qdparselabel(ads, &p,pe, label, &ll, flags);
+ if (st) return st;
+ if (!ll) return adns_s_querydomaininvalid;
+ if (ll > DNS_MAXLABEL) return adns_s_querydomaintoolong;
+ nbytes+= ll+1;
+ if (nbytes >= DNS_MAXDOMAIN) return adns_s_querydomaintoolong;