mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 03:44:22 -04:00
introduce evdns_init() which works on windows and unix.
svn:r231
This commit is contained in:
parent
07c3fb5067
commit
e9c1e3f7f0
13
evdns.c
13
evdns.c
@ -2027,3 +2027,16 @@ evdns_config_windows_nameservers(void)
|
||||
return load_nameservers_from_registry();
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
evdns_init()
|
||||
{
|
||||
int res = 0;
|
||||
#ifdef MS_WINDOWS
|
||||
evdns_config_windows_nameservers(void);
|
||||
#else
|
||||
res = evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
|
||||
#endif
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
1
evdns.h
1
evdns.h
@ -48,6 +48,7 @@
|
||||
|
||||
typedef void (*evdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
|
||||
|
||||
int evdns_init();
|
||||
int evdns_nameserver_add(unsigned long int address);
|
||||
int evdns_count_nameservers(void);
|
||||
int evdns_clear_nameservers_and_suspend(void);
|
||||
|
@ -85,11 +85,7 @@ dns_gethostbyname()
|
||||
void
|
||||
dns_suite(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
evdns_config_windows_nameservers();
|
||||
#else
|
||||
evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
|
||||
#endif
|
||||
evdns_init();
|
||||
dns_gethostbyname();
|
||||
|
||||
evdns_clear_nameservers_and_suspend();
|
||||
|
Loading…
x
Reference in New Issue
Block a user