parent a8d74646
...@@ -374,7 +374,7 @@ vmod_set_match(VRT_CTX, struct vmod_re2_set *set, VCL_STRING subject) ...@@ -374,7 +374,7 @@ vmod_set_match(VRT_CTX, struct vmod_re2_set *set, VCL_STRING subject)
return 0; return 0;
} }
priv->len = sizeof(*task); priv->len = sizeof(*task);
priv->free = NULL; AZ(priv->methods);
task = priv->priv; task = priv->priv;
task->magic = TASK_SET_MATCH_MAGIC; task->magic = TASK_SET_MATCH_MAGIC;
} }
......
...@@ -66,6 +66,13 @@ free_task_match(void *p) ...@@ -66,6 +66,13 @@ free_task_match(void *p)
vre2_fini(&task_match->vre2); vre2_fini(&task_match->vre2);
} }
static const struct vmod_priv_methods match_priv_task_methods[1] = {{
.magic = VMOD_PRIV_METHODS_MAGIC,
.type = "vmod_re2_match_priv_task",
.fini = free_task_match
}};
#define ERR_PREFIX "match(\"%.40s\"): " #define ERR_PREFIX "match(\"%.40s\"): "
static VCL_BOOL static VCL_BOOL
...@@ -315,7 +322,7 @@ vmod_regex_match(const struct vrt_ctx *ctx, struct vmod_re2_regex *re, ...@@ -315,7 +322,7 @@ vmod_regex_match(const struct vrt_ctx *ctx, struct vmod_re2_regex *re,
return 0; return 0;
} }
task->len = sizeof(*task_match); task->len = sizeof(*task_match);
task->free = NULL; AZ(task->methods);
task_match = (task_match_t *)task->priv; task_match = (task_match_t *)task->priv;
task_match->magic = TASK_MATCH_MAGIC; task_match->magic = TASK_MATCH_MAGIC;
} }
...@@ -553,7 +560,7 @@ vmod_match(VRT_CTX, struct vmod_priv *priv, VCL_STRING pattern, ...@@ -553,7 +560,7 @@ vmod_match(VRT_CTX, struct vmod_priv *priv, VCL_STRING pattern,
} }
priv->priv = task_match; priv->priv = task_match;
priv->len = sizeof(*task_match); priv->len = sizeof(*task_match);
priv->free = free_task_match; priv->methods = match_priv_task_methods;
task_match->magic = TASK_MATCH_MAGIC; task_match->magic = TASK_MATCH_MAGIC;
} }
else { else {
......
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