typedef union {
void *ext;
- int dmaddr_index;
+ adns_rr_hostaddr *hostaddr;
} qcontext;
typedef struct {
int serv;
const byte *dgram;
int dglen, nsstart, nscount, arcount;
+ struct timeval now;
} parseinfo;
typedef struct {
* If failstat is nonzero then if we are successful in creating the query
* it is immediately failed with code failstat (but _submit still succeds).
*
- * ctx is copied byte-for-byte into the query.
+ * *ctx is copied byte-for-byte into the query.
*/
void *adns__alloc_interim(adns_query qu, size_t sz);
do { \
(node)->part next= 0; \
(node)->part back= (list).tail; \
- if ((list).tail) (list).tail->part next= (node); else (list).part head= (node); \
+ if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \
(list).tail= (node); \
} while(0)
pai.nsstart= nsstart;
pai.nscount= nscount;
pai.arcount= arcount;
+ pai.now= now;
for (rri=0, nrrs=0; rri<ancount; rri++) {
st= adns__findrr(qu,serv, dgram,dglen,&cbyte,
int max, adns_rr_hostaddr *rrp) {
adns_status st;
int dmstart, cbyte;
+ qcontext ctx;
+ int id;
+ adns_query nqu;
dmstart= cbyte= *cbyte_io;
st= pap_domain(pai, &cbyte, max, &rrp->host,
if (st) return st;
if (rrp->naddrs != -1) return adns_s_ok;
- rrp->naddrs= 0; /* fixme additional section didn't have required data */
- rrp->astatus= adns_s_notimplemented;
+ st= adns__mkquery_frdgram(pai->ads, &pai->qu->vb, &id,
+ pai->dgram, pai->dglen, dmstart,
+ adns_r_addr, adns_qf_quoteok_query);
+ if (st) return st;
+
+ ctx.hostaddr= rrp;
+ st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr),
+ &pai->qu->vb, id,
+ adns_qf_quoteok_query, pai->now, 0, &ctx);
+ if (st) return st;
+
+ nqu->parent= pai->qu;
+ LIST_LINK_TAIL_PART(pai->qu->children,nqu,siblings.);
return adns_s_ok;
}