summaryrefslogtreecommitdiff
path: root/contrib/unbound/services/mesh.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/unbound/services/mesh.c')
-rw-r--r--contrib/unbound/services/mesh.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/unbound/services/mesh.c b/contrib/unbound/services/mesh.c
index 4b0c5db418f7..52ff97e4a2e8 100644
--- a/contrib/unbound/services/mesh.c
+++ b/contrib/unbound/services/mesh.c
@@ -551,6 +551,9 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo,
goto servfail_mem;
}
}
+ if(rep->c->use_h2) {
+ http2_stream_add_meshstate(rep->c->h2_stream, mesh, s);
+ }
/* add serve expired timer if required and not already there */
if(timeout && !mesh_serve_expired_init(s, timeout)) {
log_err("mesh_new_client: out of memory initializing serve expired");
@@ -1207,6 +1210,13 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
else secure = 0;
if(!rep && rcode == LDNS_RCODE_NOERROR)
rcode = LDNS_RCODE_SERVFAIL;
+ if(r->query_reply.c->use_h2) {
+ r->query_reply.c->h2_stream = r->h2_stream;
+ /* Mesh reply won't exist for long anymore. Make it impossible
+ * for HTTP/2 stream to refer to mesh state, in case
+ * connection gets cleanup before HTTP/2 stream close. */
+ r->h2_stream->mesh_state = NULL;
+ }
/* send the reply */
/* We don't reuse the encoded answer if either the previous or current
* response has a local alias. We could compare the alias records
@@ -1495,6 +1505,8 @@ int mesh_state_add_reply(struct mesh_state* s, struct edns_data* edns,
s->s.qinfo.qname_len);
if(!r->qname)
return 0;
+ if(rep->c->use_h2)
+ r->h2_stream = rep->c->h2_stream;
/* Data related to local alias stored in 'qinfo' (if any) is ephemeral
* and can be different for different original queries (even if the