Adjust to varnish-cache api changes

parent 436b71c4
...@@ -96,7 +96,7 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject, ...@@ -96,7 +96,7 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject,
snap = WS_Snapshot(ctx->ws); snap = WS_Snapshot(ctx->ws);
if (!never_capture) { if (!never_capture) {
ngroups++; ngroups++;
if (!WS_Inside(ctx->ws, subject, subject + len + 1)) if (!WS_Allocated(ctx->ws, subject, len + 1))
if ((text = WS_Copy(ctx->ws, subject, len + 1)) if ((text = WS_Copy(ctx->ws, subject, len + 1))
== NULL) { == NULL) {
VERRNOMEM(ctx, ERR_PREFIX "copying subject", VERRNOMEM(ctx, ERR_PREFIX "copying subject",
......
...@@ -59,5 +59,8 @@ struct vmod_re2_regex { ...@@ -59,5 +59,8 @@ struct vmod_re2_regex {
unsigned never_capture; unsigned never_capture;
}; };
#define WS_Assert_Allocated(ws, ptr, len) \
AN(WS_Allocated(ws, ptr, len))
/* Defined in vmod_re2.c */ /* Defined in vmod_re2.c */
extern const char * const rewrite_name[]; extern const char * const rewrite_name[];
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