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:
@@ -77,6 +77,7 @@
|
||||
#include "printf_hook.h"
|
||||
#include "utils.h"
|
||||
#include "chunk.h"
|
||||
#include "host_resolver.h"
|
||||
#include "settings.h"
|
||||
#include "integrity_checker.h"
|
||||
#include "processing/processor.h"
|
||||
@@ -170,6 +171,11 @@ struct library_t {
|
||||
*/
|
||||
scheduler_t *scheduler;
|
||||
|
||||
/**
|
||||
* resolve hosts by DNS name
|
||||
*/
|
||||
host_resolver_t *hosts;
|
||||
|
||||
/**
|
||||
* various settings loaded from settings file
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user