if(data->state.async.done) {
*dns = data->state.async.dns;
- return CURLE_OK;
+ return ares->result;
}
- if(Curl_ares_perform(ares->channel, 0) < 0)
- return CURLE_UNRECOVERABLE_POLL;
+ if(Curl_ares_perform(ares->channel, 0) < 0) {
+ result = CURLE_UNRECOVERABLE_POLL;
+ goto out;
+ }
#ifndef HAVE_CARES_GETADDRINFO
/* Now that we have checked for any last minute results above, see if there
result, *dns ? "" : "not ");
async_ares_cleanup(data);
}
+
+out:
+ ares->result = result;
return result;
}