summaryrefslogtreecommitdiff
path: root/libunbound/context.c
diff options
context:
space:
mode:
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) {