mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge remote-tracking branch 'origin/pr/86'
This commit is contained in:
commit
aeb8d345b4
13
evdns.c
13
evdns.c
@ -4044,6 +4044,19 @@ evdns_base_free(struct evdns_base *base, int fail_requests)
|
||||
evdns_base_free_and_unlock(base, fail_requests);
|
||||
}
|
||||
|
||||
void
|
||||
evdns_base_flush_outdated_host_addresses(struct evdns_base *base)
|
||||
{
|
||||
EVDNS_LOCK(base);
|
||||
struct hosts_entry *victim;
|
||||
while ((victim = TAILQ_FIRST(&base->hostsdb))) {
|
||||
TAILQ_REMOVE(&base->hostsdb, victim, next);
|
||||
mm_free(victim);
|
||||
}
|
||||
EVDNS_UNLOCK(base);
|
||||
EVTHREAD_FREE_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
|
||||
}
|
||||
|
||||
void
|
||||
evdns_shutdown(int fail_requests)
|
||||
{
|
||||
|
@ -237,6 +237,12 @@ struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize
|
||||
*/
|
||||
void evdns_base_free(struct evdns_base *base, int fail_requests);
|
||||
|
||||
/**
|
||||
All previous outdated host addresses will be removed or flushed from the event base.
|
||||
@param evdns_base the evdns base to flush outdated host addresses
|
||||
*/
|
||||
void evdns_base_flush_outdated_host_addresses(struct evdns_base *base);
|
||||
|
||||
/**
|
||||
Convert a DNS error code to a string.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user