+ * bug_if_query_done feature for debugging (SHOULD BE TAKEN OUT FOR RELEASE) privaterel-1999-03-26-head
authorian <ian>
Sun, 26 Mar 2000 15:26:17 +0000 (15:26 +0000)
committerian <ian>
Sun, 26 Mar 2000 15:26:17 +0000 (15:26 +0000)
@@ -1,5 +1,7 @@
 uadns (0.8) BETA; urgency=low

+  * bug_if_query_done feature for debugging (SHOULD BE TAKEN OUT FOR RELEASE)
+
   Bugfixes:
   * Spurious `server failure on unidentifiable query' warning suppressed.
   * adnslogres: cast chars to unsigned char before using ctype.h macros.

changelog
src/event.c
src/internal.h
src/query.c
src/setup.c

index d7868bb..aed8a56 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,5 +1,7 @@
 uadns (0.8) BETA; urgency=low
 
+  * bug_if_query_done feature for debugging (SHOULD BE TAKEN OUT FOR RELEASE) 
+
   Bugfixes:
   * Spurious `server failure on unidentifiable query' warning suppressed.
   * adnslogres: cast chars to unsigned char before using ctype.h macros.
index 1b679e6..b82b5de 100644 (file)
@@ -673,7 +673,9 @@ int adns_wait(adns_state ads,
     if (r != EAGAIN) break;
     maxfd= 0; tvp= 0;
     FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
+    ads->bug_if_query_done_now= 1;
     adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
+    ads->bug_if_query_done_now= 0;
     assert(tvp);
     rsel= select(maxfd,&readfds,&writefds,&exceptfds,tvp);
     if (rsel==-1) {
index c766738..719a592 100644 (file)
@@ -282,6 +282,7 @@ struct adns__state {
   struct query_queue udpw, tcpw, childw, output;
   adns_query forallnext;
   int nextid, udpsocket, tcpsocket;
+  int bug_if_query_done_now;
   vbuf tcpsend, tcprecv;
   int nservers, nsortlist, nsearchlist, searchndots, tcpserver, tcprecv_skip;
   enum adns__tcpstate {
index aaadb21..1fa26f8 100644 (file)
@@ -501,6 +501,7 @@ void adns__query_done(adns_query qu) {
   adns_answer *ans;
   adns_query parent;
 
+  assert(!qu->ads->bug_if_query_done_now);
   cancel_children(qu);
 
   qu->id= -1;
@@ -542,6 +543,7 @@ void adns__query_done(adns_query qu) {
 }
 
 void adns__query_fail(adns_query qu, adns_status stat) {
+  assert(!qu->ads->bug_if_query_done_now);
   adns__reset_preserved(qu);
   qu->answer->status= stat;
   adns__query_done(qu);
index ac88c33..211f425 100644 (file)
@@ -474,6 +474,7 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
   ads->forallnext= 0;
   ads->nextid= 0x311f;
   ads->udpsocket= ads->tcpsocket= -1;
+  ads->bug_if_query_done_now= 0;
   adns__vbuf_init(&ads->tcpsend);
   adns__vbuf_init(&ads->tcprecv);
   ads->tcprecv_skip= 0;