Commit 1a1b64b0 authored by Geoff Simmons's avatar Geoff Simmons

Use VRT_fail() for errors in vcl_init, as now required by Varnish.

parent bf1afdd3
......@@ -76,20 +76,13 @@ errmsg(VRT_CTX, const char *fmt, ...)
{
va_list args;
AZ(ctx->method & VCL_MET_TASK_H);
va_start(args, fmt);
if (ctx->vsl)
VSLbv(ctx->vsl, SLT_VCL_Error, fmt, args);
else
VSLv(SLT_VCL_Error, 0, fmt, args);
va_end(args);
if (ctx->method == VCL_MET_INIT) {
AN(ctx->msg);
va_start(args, fmt);
VSB_vprintf(ctx->msg, fmt, args);
va_end(args);
VRT_handling(ctx, VCL_RET_FAIL);
}
}
VCL_VOID
......@@ -108,21 +101,21 @@ vmod_regex__init(VRT_CTX, struct vmod_re_regex **rep, const char *vcl_name,
AN(pattern);
if (limit < 1) {
errmsg(ctx, "vmod re: invalid limit %d in %s constructor",
limit, vcl_name);
VRT_fail(ctx, "vmod re: invalid limit %d in %s constructor",
limit, vcl_name);
return;
}
if (limit_recursion < 1) {
errmsg(ctx, "vmod re: invalid limit_recursion %d "
"in %s constructor", limit_recursion, vcl_name);
VRT_fail(ctx, "vmod re: invalid limit_recursion %d "
"in %s constructor", limit_recursion, vcl_name);
return;
}
if ((vre = VRE_compile(pattern, 0, &error, &erroffset)) == NULL) {
errmsg(ctx, "vmod re: error compiling regex \"%s\" in %s "
"constructor: %s (at offset %d)", pattern, vcl_name,
error, erroffset);
VRT_fail(ctx, "vmod re: error compiling regex \"%s\" in %s "
"constructor: %s (at offset %d)", pattern, vcl_name,
error, erroffset);
return;
}
......
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