|
|
|
@ -711,8 +711,6 @@ ares_status_t ares__servers_update(ares_channel_t *channel, |
|
|
|
|
return ARES_EFORMERR; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ares__channel_lock(channel); |
|
|
|
|
|
|
|
|
|
/* NOTE: a NULL or zero entry server list is considered valid due to
|
|
|
|
|
* real-world people needing support for this for their test harnesses |
|
|
|
|
*/ |
|
|
|
@ -781,7 +779,6 @@ ares_status_t ares__servers_update(ares_channel_t *channel, |
|
|
|
|
status = ARES_SUCCESS; |
|
|
|
|
|
|
|
|
|
done: |
|
|
|
|
ares__channel_unlock(channel); |
|
|
|
|
return status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1109,8 +1106,9 @@ int ares_set_servers(ares_channel_t *channel, |
|
|
|
|
return (int)status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
ares__channel_lock(channel); |
|
|
|
|
status = ares__servers_update(channel, slist, ARES_TRUE); |
|
|
|
|
ares__channel_unlock(channel); |
|
|
|
|
|
|
|
|
|
ares__llist_destroy(slist); |
|
|
|
|
|
|
|
|
@ -1132,8 +1130,9 @@ int ares_set_servers_ports(ares_channel_t *channel, |
|
|
|
|
return (int)status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
ares__channel_lock(channel); |
|
|
|
|
status = ares__servers_update(channel, slist, ARES_TRUE); |
|
|
|
|
ares__channel_unlock(channel); |
|
|
|
|
|
|
|
|
|
ares__llist_destroy(slist); |
|
|
|
|
|
|
|
|
@ -1151,11 +1150,12 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) |
|
|
|
|
return ARES_ENODATA; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
|
|
|
|
|
if (ares_strlen(_csv) == 0) { |
|
|
|
|
/* blank all servers */ |
|
|
|
|
return ares__servers_update(channel, NULL, ARES_TRUE); |
|
|
|
|
ares__channel_lock(channel); |
|
|
|
|
status = ares__servers_update(channel, NULL, ARES_TRUE); |
|
|
|
|
ares__channel_unlock(channel); |
|
|
|
|
return status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
status = ares__sconfig_append_fromstr(&slist, _csv, ARES_FALSE); |
|
|
|
@ -1164,8 +1164,9 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) |
|
|
|
|
return status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
ares__channel_lock(channel); |
|
|
|
|
status = ares__servers_update(channel, slist, ARES_TRUE); |
|
|
|
|
ares__channel_unlock(channel); |
|
|
|
|
|
|
|
|
|
ares__llist_destroy(slist); |
|
|
|
|
|
|
|
|
@ -1175,13 +1176,11 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) |
|
|
|
|
/* We'll go ahead and honor ports anyhow */ |
|
|
|
|
int ares_set_servers_csv(ares_channel_t *channel, const char *_csv) |
|
|
|
|
{ |
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
return (int)set_servers_csv(channel, _csv); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int ares_set_servers_ports_csv(ares_channel_t *channel, const char *_csv) |
|
|
|
|
{ |
|
|
|
|
/* NOTE: lock is in ares__servers_update() */ |
|
|
|
|
return (int)set_servers_csv(channel, _csv); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|