chiark / gitweb /
actually clean out unwanted file handlers; docuemtn -reverse options in right place
authorian <ian>
Sun, 19 Dec 2004 23:26:32 +0000 (23:26 +0000)
committerian <ian>
Sun, 19 Dec 2004 23:26:32 +0000 (23:26 +0000)
adns/adns.c

index 01f0dc6..78b6d79 100644 (file)
@@ -37,6 +37,8 @@
  *         -quotefail-cname
  *         -cname-loose
  *         -cname-forbid
+ *         -reverse
+ *         -reverse-any ZONE-A-LIKE
  *
  * adns new-resolver [RES-OPTIONS...]                         => RESOLVER
  *        options:
@@ -46,8 +48,6 @@
  *         -noenv|-debug|-logpid
  *         -checkc-entex
  *         -checkc-freq
- *         -reverse
- *         -reverse-any ZONE-A-LIKE
  *         -config CONFIG-STRING
  *
  * adns set-default-resolver RESOLVER
@@ -301,8 +301,8 @@ static void destroy_resolver_defcb(ClientData resolver_v, Tcl_Interp *ip) {
 }
 
 int do_adns_destroy_resolver(ClientData cd, Tcl_Interp *ip, void *res_v) {
-  destroy_resolver(ip,res_v);
   tabledataid_disposing(ip,res_v,&adnstcl_resolvers);
+  destroy_resolver(ip,res_v);
   return TCL_OK;
 }
 
@@ -637,9 +637,15 @@ static void asynch_sethandlers_generic(Resolver *res,
        if (FD_ISSET(fd, &want[0])) mask |= TCL_READABLE;
        if (FD_ISSET(fd, &want[1])) mask |= TCL_WRITABLE;
        if (FD_ISSET(fd, &want[2])) mask |= TCL_EXCEPTION;
-       if (mask) Tcl_CreateFileHandler(fd,mask,asynch_filehandler,res);
-       else Tcl_DeleteFileHandler(fd);
+       if (mask) {
+         Tcl_CreateFileHandler(fd,mask,asynch_filehandler,res);
+         FD_SET(fd, &res->handling[i]);
+       } else {
+         Tcl_DeleteFileHandler(fd);
+         FD_CLR(fd, &res->handling[i]);
+       }
       }
+  res->maxfd= maxfd;
 
   Tcl_DeleteTimerHandler(res->timertoken);