From be4d66dc60264126ba6b3fbd67609ef0b6c0d266 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 31 May 2014 18:56:42 +0100 Subject: [PATCH] src/: adns__internal_submit can modify ctx->tinfo. It will be convenient for type hooks to store information in their part of the query context before the query is properly established. We could have adns__internal_submit make a copy of the caller's context, but it turns out that none of them actually care if we change it. Signed-off-by: Mark Wooding --- src/internal.h | 5 +++-- src/query.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/internal.h b/src/internal.h index fed8466..3816881 100644 --- a/src/internal.h +++ b/src/internal.h @@ -455,7 +455,7 @@ adns_status adns__internal_submit(adns_state ads, adns_query *query_r, const typeinfo *typei, vbuf *qumsg_vb, int id, adns_queryflags flags, struct timeval now, - const qcontext *ctx); + qcontext *ctx); /* Submits a query (for internal use, called during external submits). * * The new query is returned in *query_r, or we return adns_s_nomemory. @@ -464,7 +464,8 @@ adns_status adns__internal_submit(adns_state ads, adns_query *query_r, * the memory for it is _taken over_ by this routine whether it * succeeds or fails (if it succeeds, the vbuf is reused for qu->vb). * - * *ctx is copied byte-for-byte into the query. + * *ctx is copied byte-for-byte into the query. Before doing this, its tinfo + * field may be modified by type hooks. * * When the child query is done, ctx->callback will be called. The * child will already have been taken off both the global list of diff --git a/src/query.c b/src/query.c index 2b36d04..336def7 100644 --- a/src/query.c +++ b/src/query.c @@ -112,7 +112,7 @@ adns_status adns__internal_submit(adns_state ads, adns_query *query_r, const typeinfo *typei, vbuf *qumsg_vb, int id, adns_queryflags flags, struct timeval now, - const qcontext *ctx) { + qcontext *ctx) { adns_query qu; qu= query_alloc(ads,typei,typei->typekey,flags,now); -- 2.30.2