dirmngr: Use one context for all libdns queries.
authorWerner Koch <wk@gnupg.org>
Fri, 16 Dec 2016 20:00:14 +0000 (21:00 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 16 Dec 2016 20:00:14 +0000 (21:00 +0100)
commitc4e8a3194d6b92f596a6483e486c645de7d2ddd1
tree5d6eb7751981880a111f32ab9e3ac29110894346
parentddb48086833f8b86f0f0d69b21a23f245090ea7a
dirmngr: Use one context for all libdns queries.

* dirmngr/dns-stuff.c (libdns_reinit_pending): New var.
(enable_recursive_resolver): Set var.
(set_dns_nameserver): Ditto.
(libdns_init): Avoid double initialization.
(libdns_deinit): New.
(reload_dns_stuff): New.
(libdns_res_open): Act upon LIBDNS_REINIT_PENDING.
* dirmngr/t-dns-stuff.c (main): Call reload_dns_stuff to release
memory.
* dirmngr/dirmngr.c (cleanup): Ditto.
(dirmngr_sighup_action): Call reload_dns_stuff to set
LIBDNS_REINIT_PENDING.

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/dirmngr.c
dirmngr/dns-stuff.c
dirmngr/dns-stuff.h
dirmngr/t-dns-stuff.c