mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed.
svn:r1369
This commit is contained in:
parent
f4775918cd
commit
670658ebd7
29
evdns.c
29
evdns.c
@ -3538,13 +3538,32 @@ load_nameservers_from_registry(struct evdns_base *base)
|
||||
#undef TRY
|
||||
}
|
||||
|
||||
static int
|
||||
evdns_config_windows_nameservers(struct evdns_base *base)
|
||||
int
|
||||
evdns_base_config_windows_nameservers(struct evdns_base *base)
|
||||
{
|
||||
ASSERT_LOCKED(base);
|
||||
int r;
|
||||
if (base == NULL)
|
||||
base = current_base;
|
||||
if (base == NULL)
|
||||
return -1;
|
||||
EVDNS_LOCK(base);
|
||||
if (load_nameservers_with_getnetworkparams(base) == 0)
|
||||
return 0;
|
||||
return load_nameservers_from_registry(base);
|
||||
r = load_nameservers_from_registry(base);
|
||||
EVDNS_UNLOCK(base);
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
evdns_config_windows_nameservers(void)
|
||||
{
|
||||
if (!current_base) {
|
||||
current_base = evdns_base_new(NULL, 1);
|
||||
return current_base == NULL ? -1 : 0;
|
||||
} else {
|
||||
return evdns_base_config_windows_nameservers(current_base);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -3582,7 +3601,7 @@ evdns_base_new(struct event_base *event_base, int initialize_nameservers)
|
||||
if (initialize_nameservers) {
|
||||
int r;
|
||||
#ifdef WIN32
|
||||
r = evdns_config_windows_nameservers(base);
|
||||
r = evdns_base_config_windows_nameservers(base);
|
||||
#else
|
||||
r = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, "/etc/resolv.conf");
|
||||
#endif
|
||||
|
@ -447,8 +447,8 @@ int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char
|
||||
@see evdns_resolv_conf_parse()
|
||||
*/
|
||||
#ifdef WIN32
|
||||
int evdns_config_windows_nameservers(void);
|
||||
#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
|
||||
int evdns_base_config_windows_nameservers(struct evdns_base *);
|
||||
#define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -313,6 +313,11 @@ void evdns_search_ndots_set(const int ndots);
|
||||
*/
|
||||
struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int is_tcp, evdns_request_callback_fn_type callback, void *user_data);
|
||||
|
||||
#ifdef WIN32
|
||||
int evdns_config_windows_nameservers(void);
|
||||
#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user