Commit e1f2e3d6 authored by Nils Goroll's avatar Nils Goroll

simplify vmod_shard_backend() LAZY handling

parent b12b8294
...@@ -606,27 +606,20 @@ vmod_shard_backend(VRT_CTX, struct vmod_directors_shard *vshard, ...@@ -606,27 +606,20 @@ vmod_shard_backend(VRT_CTX, struct vmod_directors_shard *vshard,
switch (resolve) { switch (resolve) {
case LAZY: case LAZY:
if ((ctx->method & VCL_MET_TASK_B) == 0) { if ((args & ~arg_resolve) == 0) {
if ((args & ~arg_resolve) != 0) {
VRT_fail(ctx,
"shard .backend resolve=LAZY "
"with other parameters can "
"only be used in backend "
"context");
return (NULL);
}
AN(vshard->dir); AN(vshard->dir);
return (vshard->dir); return (vshard->dir);
} }
assert(ctx->method & VCL_MET_TASK_B); if ((ctx->method & VCL_MET_TASK_B) == 0) {
VRT_fail(ctx, "shard .backend resolve=LAZY with other "
if ((args & ~arg_resolve) == 0) { "parameters can only be used in backend "
/* no other parameters - shortcut */ "context");
AN(vshard->dir); return (NULL);
return (vshard->dir);
} }
assert(ctx->method & VCL_MET_TASK_B);
pp = shard_param_task(ctx, vshard, vshard->param); pp = shard_param_task(ctx, vshard, vshard->param);
if (pp == NULL) if (pp == NULL)
return (NULL); return (NULL);
......
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