chiark / gitweb /
Reentrancy: Avoid reentrant callbacks
[adns.git] / src / setup.c
index 54d2d0f9adc5bbde5e2ad2777ecfbb3de8450880..e853ab797e36139b015a3f1bb628fd6a38fa3377 100644 (file)
@@ -558,6 +558,7 @@ static int init_begin(adns_state *ads_r, adns_initflags flags,
   LIST_INIT(ads->tcpw);
   LIST_INIT(ads->childw);
   LIST_INIT(ads->output);
+  LIST_INIT(ads->intdone);
   ads->forallnext= 0;
   ads->nextid= 0x311f;
   ads->nudp= 0;
@@ -725,10 +726,11 @@ void adns_finish(adns_state ads) {
   int i;
   adns__consistency(ads,0,cc_entex);
   for (;;) {
-    if (ads->udpw.head) adns_cancel(ads->udpw.head);
-    else if (ads->tcpw.head) adns_cancel(ads->tcpw.head);
-    else if (ads->childw.head) adns_cancel(ads->childw.head);
-    else if (ads->output.head) adns_cancel(ads->output.head);
+    if (ads->udpw.head) adns__cancel(ads->udpw.head);
+    else if (ads->tcpw.head) adns__cancel(ads->tcpw.head);
+    else if (ads->childw.head) adns__cancel(ads->childw.head);
+    else if (ads->output.head) adns__cancel(ads->output.head);
+    else if (ads->intdone.head) adns__cancel(ads->output.head);
     else break;
   }
   for (i=0; i<ads->nudp; i++) close(ads->udpsocket[i].fd);