chiark / gitweb /
src/: adns__internal_submit can modify ctx->tinfo.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 31 May 2014 17:56:42 +0000 (18:56 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 13 Jun 2014 08:57:41 +0000 (09:57 +0100)
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 <mdw@distorted.org.uk>
src/internal.h
src/query.c

index fed84663626f2eeae1c1709a04b425451a995789..38168814e8d32029beaecab2979874dffe337869 100644 (file)
@@ -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
index 2b36d041f4a19967638daf5c5941ae62b117caaa..336def77da8570b59c192e6b0874fa99398d8c07 100644 (file)
@@ -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);