Commit 7a710b49 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Jeff helped me pinpoint that we didn't properly set the expire timer during

c-ares name resolves, but now we do!
parent 0bb20cc6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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;
}