summaryrefslogtreecommitdiff
path: root/libunbound/context.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2018-09-10 16:30:18 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2018-09-10 16:30:18 +0000
commit7b6fdf425a9ef38fe9e16779b3af25863104d9c0 (patch)
tree1ac9dd11604f49ca6a2feae373ff4dc7e6fb0002 /libunbound/context.c
parent4289761a7b61df4b64c11ada446a187df61e6a1e (diff)
Diffstat (limited to 'libunbound/context.c')
-rw-r--r--libunbound/context.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libunbound/context.c b/libunbound/context.c
index 8bff713bca306..6ac8086bf6727 100644
--- a/libunbound/context.c
+++ b/libunbound/context.c
@@ -130,7 +130,7 @@ find_id(struct ub_ctx* ctx, int* id)
struct ctx_query*
context_new(struct ub_ctx* ctx, const char* name, int rrtype, int rrclass,
- ub_callback_type cb, void* cbarg)
+ ub_callback_type cb, ub_event_callback_type cb_event, void* cbarg)
{
struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q));
if(!q) return NULL;
@@ -142,8 +142,9 @@ context_new(struct ub_ctx* ctx, const char* name, int rrtype, int rrclass,
}
lock_basic_unlock(&ctx->cfglock);
q->node.key = &q->querynum;
- q->async = (cb != NULL);
+ q->async = (cb != NULL || cb_event != NULL);
q->cb = cb;
+ q->cb_event = cb_event;
q->cb_arg = cbarg;
q->res = (struct ub_result*)calloc(1, sizeof(*q->res));
if(!q->res) {