chiark / gitweb /
cname_loose/cname_forbid implemented; production timeout
authorian <ian>
Sat, 5 Dec 1998 18:51:37 +0000 (18:51 +0000)
committerian <ian>
Sat, 5 Dec 1998 18:51:37 +0000 (18:51 +0000)
src/adns.h
src/event.c
src/internal.h
src/reply.c
src/types.c

index d4ca0df686bfe76af59cfb2795925d936fa2acd3..3c06ff6090430a4622c4568f9ec9758bc6e3358f 100644 (file)
@@ -135,8 +135,6 @@ typedef enum {
   
   adns_s_max_misconfig= 199,
 
-  /* fixme: implement _s_cname */
-
   /* permanent problems with the query */
   adns_s_querydomainwrong,
   adns_s_querydomaininvalid,
index d42afbd15df2e9be1e806759f94063ef662cb1b1..19fa62068fef48f48bfb29db23eb1092c836def5 100644 (file)
@@ -76,7 +76,6 @@ void adns__tcp_tryconnect(adns_state ads, struct timeval now) {
   int r, fd, tries;
   struct sockaddr_in addr;
   struct protoent *proto;
-  /* fixme: single TCP timeout, not once per server */
 
   for (tries=0; tries<ads->nservers; tries++) {
     if (ads->tcpstate == server_connecting || ads->tcpstate == server_ok) return;
index 92debfd4cb9dc028225b61ee33d12e5d51d67eae..62f3e699570c2b92495d16901315ce55f72ac18d 100644 (file)
@@ -40,7 +40,7 @@ typedef unsigned char byte;
 
 #define MAXSERVERS 5
 #define MAXSORTLIST 15
-#define UDPMAXRETRIES /*15 fixme*/5
+#define UDPMAXRETRIES 15
 #define UDPRETRYMS 2000
 #define TCPMS 30000
 #define LOCALRESOURCEMS 20
index 6198d07dccb8a1c01844495fdf94d2ab9e67f332..90314763f656b1f6a9cdaef4f08818b824593a83 100644 (file)
@@ -157,7 +157,10 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
     }
     if (rrtype == adns_r_cname && /* fixme - implement adns_qf_nocname */
        (qu->typei->type & adns__rrt_typemask) != adns_r_cname) {
-      if (!qu->cname_dgram) { /* Ignore second and subsequent CNAMEs */
+      if (qu->flags & adns_qf_cname_forbid) {
+       adns__query_fail(qu,adns_s_prohibitedcname);
+       return;
+      } else if (!qu->cname_dgram) { /* Ignore second and subsequent CNAMEs */
        qu->cname_begin= rdstart;
        qu->cname_dglen= dglen;
        st= adns__parse_domain(ads,serv,qu, &qu->vb,
index 32db2841acd41837e7af93d463236077778126e3..9f7dbd336a6b01333432c3823ee271ed209163a2 100644 (file)
@@ -432,6 +432,7 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
   qcontext ctx;
   int id;
   adns_query nqu;
+  adns_queryflags nflags;
 
   dmstart= cbyte= *cbyte_io;
   st= pap_domain(pai, &cbyte, max, &rrp->host,
@@ -461,9 +462,12 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io,
   ctx.ext= 0;
   ctx.callback= icb_hostaddr;
   ctx.info.hostaddr= rrp;
+  
+  nflags= adns_qf_quoteok_query;
+  if (!(pai->qu->flags & adns_qf_cname_loose)) nflags |= adns_qf_cname_forbid;
+  
   st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr),
-                           &pai->qu->vb, id,
-                           adns_qf_quoteok_query, pai->now, 0, &ctx);
+                           &pai->qu->vb, id, nflags, pai->now, 0, &ctx);
   if (st) return st;
 
   nqu->parent= pai->qu;