Commit 3b041dfe authored by Nils Goroll's avatar Nils Goroll Committed by Geoff Simmons

Wait for sub requests to finish before deleting the node

Fixes https://gitlab.com/uplex/varnish/libvdp-pesi/-/issues/10
parent e0de5442
......@@ -44,6 +44,7 @@
#include "node_assert.h"
#include "node_mempool.h"
#include "pesi.h"
#include "pesi_tree.h"
#include "misc.h"
......@@ -623,6 +624,13 @@ fini_subreq(const struct vdp_ctx *vdx, struct node *node)
assert(node->type == T_SUBREQ);
if (node->subreq.done == 0) {
CAST_OBJ_NOTNULL(subreq, node->subreq.req, REQ_MAGIC);
CAST_OBJ_NOTNULL(pesi, subreq->transport_priv, PESI_MAGIC);
CHECK_OBJ_NOTNULL(pesi->pesi_tree, PESI_TREE_MAGIC);
CHECK_OBJ_NOTNULL(pesi->pesi_tree->tree, BYTES_TREE_MAGIC);
subreq_wait_done(node, pesi->pesi_tree->tree);
}
AN(node->subreq.done);
if (node->subreq.req == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment