Resolve hosts by DNS name in separate threads so we can cancel them
getaddrinfo(3) may block a long time so proper termination of the daemon may block if DNS servers are not reachable. getaddrinfo(3) is an optional cancellation point in posix threads so it might still block a shutdown but at least on Android (with the signal based pthread_cancel implementation) it works, on Linux starter will kill charon anyway after a while.
This commit is contained in:
@@ -84,7 +84,8 @@ static void destroy(private_daemon_t *this)
|
||||
{
|
||||
/* terminate all idle threads */
|
||||
lib->processor->set_threads(lib->processor, 0);
|
||||
|
||||
/* make sure nobody waits for a DNS query */
|
||||
lib->hosts->flush(lib->hosts);
|
||||
/* close all IKE_SAs */
|
||||
if (this->public.ike_sa_manager)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user