Commit 329c810f authored by Nils Goroll's avatar Nils Goroll

polish argstruct conversion

parent 52ff0015
...@@ -591,22 +591,25 @@ cluster_choose(VRT_CTX, ...@@ -591,22 +591,25 @@ cluster_choose(VRT_CTX,
return (decide(ctx, pr, resolve, decision)); return (decide(ctx, pr, resolve, decision));
} }
#define arg2csarg(arg) {{ \
.valid_deny = arg->valid_deny, \
.valid_real = arg->valid_real, \
.valid_uncacheable_direct = arg->valid_uncacheable_direct, \
.deny = arg->deny, \
.real = arg->real, \
.uncacheable_direct = arg->uncacheable_direct \
}}
VCL_BACKEND VCL_BACKEND
vmod_cluster_backend(VRT_CTX, vmod_cluster_backend(VRT_CTX,
struct vmod_cluster_cluster *vc, struct vmod_cluster_cluster *vc,
struct VARGS(cluster_backend) *arg) struct VARGS(cluster_backend) *arg)
{ {
enum resolve_e res = parse_resolve_e(arg->resolve); enum resolve_e res = parse_resolve_e(arg->resolve);
struct VARGS(cluster_cluster_selected) struct VARGS(cluster_cluster_selected) csarg[1] = arg2csarg(arg);
carg[1] = {{
.valid_deny = arg->valid_deny, return (cluster_choose(ctx, vc, res, NULL, csarg));
.valid_real = arg->valid_real,
.valid_uncacheable_direct = arg->valid_uncacheable_direct,
.deny = arg->deny,
.real = arg->real,
.uncacheable_direct = arg->uncacheable_direct
}};
return (cluster_choose(ctx, vc, res, NULL, carg));
} }
static enum decision_e static enum decision_e
...@@ -655,17 +658,9 @@ vmod_cluster_real_selected(VRT_CTX, ...@@ -655,17 +658,9 @@ vmod_cluster_real_selected(VRT_CTX,
struct VARGS(cluster_real_selected) *arg) struct VARGS(cluster_real_selected) *arg)
{ {
enum decision_e decision; enum decision_e decision;
struct VARGS(cluster_cluster_selected) struct VARGS(cluster_cluster_selected) csarg[1] = arg2csarg(arg);
carg[1] = {{
.valid_deny = arg->valid_deny, decision = cluster_selected(ctx, "real_selected", vc, csarg);
.valid_real = arg->valid_real,
.valid_uncacheable_direct = arg->valid_uncacheable_direct,
.deny = arg->deny,
.real = arg->real,
.uncacheable_direct = arg->uncacheable_direct
}};
decision = cluster_selected(ctx, "real_selected", vc, carg);
if (decision == D_NULL) if (decision == D_NULL)
return (0); return (0);
......
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