libc-ares migration
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 8 Jan 2011 16:16:18 +0000 (17:16 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 8 Jan 2011 16:16:18 +0000 (17:16 +0100)
  - ev_io_stop removes us from the list, but we still want to receive stuff.

citadel/modules/c-ares-dns/serv_c-ares-dns.c

index adb0827f35cab7bcea4206442f25f87d74f2bb06..ec55ed9e0c1cc4150e5a32fb138312534475547b 100644 (file)
@@ -220,7 +220,7 @@ void QueryCb(void *arg,
        IO->DNSStatus = status;
        if (status == ARES_SUCCESS)
                IO->DNS_CB(arg, abuf, alen);
-       ev_io_stop(event_base, &IO->dns_io_event);
+///    ev_io_stop(event_base, &IO->dns_io_event);
                
        IO->PostDNS(IO);
 }
@@ -307,7 +307,9 @@ void SockStateCb(void *data, int sock, int read, int write)
        AsyncIO *IO = data;
 /* already inside of the event queue. */       
 
-       if (IO->dns_io_event.fd != sock) {
+       if ((read == 0) && (write == 0)) {
+//             ev_io_stop(event_base, &IO->dns_io_event);
+       } else if (IO->dns_io_event.fd != sock) {
                if (IO->dns_io_event.fd != 0) {
                        ev_io_stop(event_base, &IO->dns_io_event);
                }