aboutsummaryrefslogtreecommitdiff
path: root/lib/hostares.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-10-03 13:19:34 +0000
committerYang Tse <yangsita@gmail.com>2007-10-03 13:19:34 +0000
commit3f3a38f9c6cd87b767d2a9e1f713ac975bda5f80 (patch)
tree517dc5486ac4b1ff4503756897314c087cd8c4ef /lib/hostares.c
parent4bf28cb904212e37a31403a21c3d9db1f921367d (diff)
Fix issue related with the use of ares_timeout() result.
Diffstat (limited to 'lib/hostares.c')
-rw-r--r--lib/hostares.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/hostares.c b/lib/hostares.c
index 4c49411ae..81707ac7c 100644
--- a/lib/hostares.c
+++ b/lib/hostares.c
@@ -109,7 +109,8 @@ int Curl_resolv_getsock(struct connectdata *conn,
{
struct timeval maxtime;
- struct timeval timeout;
+ struct timeval timebuf;
+ struct timeval *timeout;
int max = ares_getsock(conn->data->state.areschannel,
(int *)socks, numsocks);
@@ -117,10 +118,10 @@ int Curl_resolv_getsock(struct connectdata *conn,
maxtime.tv_sec = CURL_TIMEOUT_RESOLVE;
maxtime.tv_usec = 0;
- ares_timeout(conn->data->state.areschannel, &maxtime, &timeout);
+ timeout = ares_timeout(conn->data->state.areschannel, &maxtime, &timebuf);
Curl_expire(conn->data,
- (timeout.tv_sec * 1000) + (timeout.tv_usec/1000) );
+ (timeout->tv_sec * 1000) + (timeout->tv_usec/1000));
return max;
}
@@ -254,7 +255,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
tvp = ares_timeout(data->state.areschannel, &store, &tv);
/* use the timeout period ares returned to us above */
- ares_waitperform(conn, tv.tv_sec * 1000 + tv.tv_usec/1000);
+ ares_waitperform(conn, tvp->tv_sec * 1000 + tvp->tv_usec/1000);
if(conn->async.done)
break;