diff --git a/src/anchor.c b/src/anchor.c index 8a615657..62a7786f 100644 --- a/src/anchor.c +++ b/src/anchor.c @@ -803,6 +803,7 @@ void _getdns_context_equip_with_anchor( context->trust_anchors = ta; context->trust_anchors_len = ta_len; context->trust_anchors_source = GETDNS_TASRC_XML; + _getdns_ta_notify_dnsreqs(context); } } else DEBUG_ANCHOR("Could not allocate space for XML file"); @@ -811,6 +812,7 @@ void _getdns_context_equip_with_anchor( context->trust_anchors = context->trust_anchors_spc; context->trust_anchors_len = ta_len; context->trust_anchors_source = GETDNS_TASRC_XML; + _getdns_ta_notify_dnsreqs(context); } DEBUG_ANCHOR("ta: %p, ta_len: %d\n", (void *)context->trust_anchors, (int)context->trust_anchors_len); diff --git a/src/general.c b/src/general.c index 21448641..8ca253b9 100644 --- a/src/general.c +++ b/src/general.c @@ -571,11 +571,6 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop, if (extensions && (r = validate_extensions(extensions))) return r; - /* Set up the context assuming we won't use the specified namespaces. - This is (currently) identical to setting up a pure DNS namespace */ - if ((r = _getdns_context_prepare_for_resolution(context, 0))) - return r; - /* create the request */ if (!(req = _getdns_dns_req_new( context, loop, name, request_type, extensions, &now_ms))) @@ -592,6 +587,11 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop, if (context->trust_anchors_source == GETDNS_TASRC_NONE) _getdns_start_fetching_ta(context, loop); } + /* Set up the context assuming we won't use the specified namespaces. + This is (currently) identical to setting up a pure DNS namespace */ + if ((r = _getdns_context_prepare_for_resolution(context, 0))) + return r; + if (return_netreq_p) *return_netreq_p = req->netreqs[0];