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