ares: Fixed compilation under Visual Studio 2012

This commit is contained in:
Kim Vandry 2013-11-10 12:08:57 -05:00 committed by Steve Holme
parent 9b67960421
commit 0f81fbe5da

View File

@ -645,10 +645,10 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
const char *local_ip4)
{
#if (ARES_VERSION >= 0x010704)
uint32_t a4;
struct in_addr a4;
if((!local_ip4) || (local_ip4[0] == 0)) {
a4 = 0; /* disabled: do not bind to a specific address */
a4.s_addr = 0; /* disabled: do not bind to a specific address */
}
else {
if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) {
@ -656,7 +656,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
}
}
ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4));
ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4.s_addr));
return CURLE_OK;
#else /* c-ares version too old! */