Use $Restrict

parent 0e4a4cab
......@@ -177,11 +177,7 @@ vmod_parser_expect(VRT_CTX,
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vfpa, VMOD_FROZEN_PARSER_MAGIC);
if (ctx->method != VCL_MET_INIT) {
VRT_fail(ctx, "%s.expect() may only be called from vcl_init {}",
vfpa->vcl_name);
return;
}
assert(ctx->method == VCL_MET_INIT);
if (vfpa->n_expect == vfpa->s_expect) {
n = vfpa->s_expect << 1;
......
......@@ -82,7 +82,7 @@ value. For ``type = ANY``, `null` is _not_ implied.
The `required` argument speifies if presence of this value is required
for successful `.match()`
This method may only be called from ``vcl_init {}``.
$Restrict vcl_init
For best efficiency, call `.expect` according to the most likely order
of elements in JSON input to be parsed.
......
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