aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-10-17 08:06:27 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-10-17 08:06:27 +0000
commit7a710b4970a183a2f0987419706758ffd918cecc (patch)
tree408512a448957f20e4352ab69587af6e54032ce7 /lib
parent0bb20cc61184c92eb75d92d452ab8298a8281b8b (diff)
Jeff helped me pinpoint that we didn't properly set the expire timer during
c-ares name resolves, but now we do!
Diffstat (limited to 'lib')
-rw-r--r--lib/hostares.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/hostares.c b/lib/hostares.c
index 035d0e222..1db0f4320 100644
--- a/lib/hostares.c
+++ b/lib/hostares.c
@@ -75,6 +75,7 @@
#include "share.h"
#include "strerror.h"
#include "url.h"
+#include "multiif.h"
#include "connect.h" /* for the Curl_sockerrno() proto */
#define _MPRINTF_REPLACE /* use our functions only */
@@ -109,9 +110,20 @@ int Curl_resolv_getsock(struct connectdata *conn,
int numsocks)
{
+ struct timeval maxtime;
+ struct timeval timeout;
int max = ares_getsock(conn->data->state.areschannel,
(int *)socks, numsocks);
+
+ maxtime.tv_sec = CURL_TIMEOUT_RESOLVE;
+ maxtime.tv_usec = 0;
+
+ ares_timeout(conn->data->state.areschannel, &maxtime, &timeout);
+
+ Curl_expire(conn->data,
+ (timeout.tv_sec * 1000) + (timeout.tv_usec/1000) );
+
return max;
}