aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-09-11 21:27:19 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-09-11 21:27:19 +0000
commitc1f31180a27e257c4a6993c984cf5a1933e2b30e (patch)
treef154221761d111729de6810d07aecce0c545c9c6
parentd4ab68cd51318b1f0d29bd30a8020aebef967d0a (diff)
Curl_is_resolved(): FD_ZERO the file descriptors before we call ares_fds().
Problem tracked down by Bjorn Reese.
-rw-r--r--lib/hostip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 8a2b1a218..c397a3c75 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -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);