Esempio n. 1
0
static int getaddrinfo_complete(struct connectdata *conn)
{
  struct thread_sync_data *tsd = conn_thread_sync_data(conn);
  int rc;

  rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res);
  /* The tsd->res structure has been copied to async.dns and perhaps the DNS
     cache.  Set our copy to NULL so destroy_thread_sync_data doesn't free it.
  */
  tsd->res = NULL;

  return rc;
}
Esempio n. 2
0
static void ares_query_completed_cb(void *arg,  /* (struct connectdata *) */
                                    int status,
#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
                                    int timeouts,
#endif
                                    struct hostent *hostent)
{
  struct connectdata *conn = (struct connectdata *)arg;
  struct Curl_addrinfo * ai = NULL;

#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
  (void)timeouts; /* ignored */
#endif

  if (status == CURL_ASYNC_SUCCESS) {
    ai = Curl_he2ai(hostent, conn->async.port);
  }

  (void)Curl_addrinfo_callback(arg, status, ai);
}