Curl_is_resolved(): FD_ZERO the file descriptors before we call ares_fds().
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Sep 2003 21:27:19 +0000 (21:27 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Sep 2003 21:27:19 +0000 (21:27 +0000)
Problem tracked down by Bjorn Reese.

lib/hostip.c

index 8a2b1a2..c397a3c 100644 (file)
@@ -400,7 +400,11 @@ CURLcode Curl_is_resolved(struct connectdata *conn, bool *done)
   static const struct timeval tv={0,0};
   int count;
   struct SessionHandle *data = conn->data;
-  int nfds = ares_fds(data->state.areschannel, &read_fds, &write_fds);
+  int nfds;
+
+  FD_ZERO(&read_fds);
+  FD_ZERO(&write_fds);
+  nfds = ares_fds(data->state.areschannel, &read_fds, &write_fds);
 
   count = select(nfds, &read_fds, &write_fds, NULL,
                  (struct timeval *)&tv);