chiark / gitweb /
_Submits_ but does not use the results from internally-generated queries.
authorian <ian>
Sun, 15 Nov 1998 19:10:43 +0000 (19:10 +0000)
committerian <ian>
Sun, 15 Nov 1998 19:10:43 +0000 (19:10 +0000)
src/internal.h
src/reply.c
src/types.c

index 985da50ff72a7b2519a0985818c004ccc64def16..f1f4d9650da70328c9b5c515d55c8b9e797b0594 100644 (file)
@@ -77,7 +77,7 @@ typedef struct {
 
 typedef union {
   void *ext;
-  int dmaddr_index;
+  adns_rr_hostaddr *hostaddr;
 } qcontext;
 
 typedef struct {
@@ -86,6 +86,7 @@ typedef struct {
   int serv;
   const byte *dgram;
   int dglen, nsstart, nscount, arcount;
+  struct timeval now;
 } parseinfo;
 
 typedef struct {
@@ -337,7 +338,7 @@ int adns__internal_submit(adns_state ads, adns_query *query_r,
  * 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);
@@ -547,7 +548,7 @@ static inline int ctype_alpha(int c) {
   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)
 
index ceeaceeeb4d7390523c9b734ae46946515fc3d7f..9d11607871b6acec51ae2ec6884c8d68a0170c3e 100644 (file)
@@ -268,6 +268,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
   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,
index 21b321c5e768638f1f0a3fa45169f585fdc21966..e494ab36554fadb88d70dc557b393cd80705fcce 100644 (file)
@@ -353,6 +353,9 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
                                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,
@@ -374,8 +377,19 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
   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;
 }