Commit a1aa7632 authored by Nils Goroll's avatar Nils Goroll

switch to VRT_DirectorResolve

parent 0965a167
......@@ -2,4 +2,6 @@ working POC for a director to facilitate cache-clustering.
This is work in progress.
As of 2018-05-09, needs master.patch applied to varnish-cache master
As of 2018-05-23, this vmod requires branch VRT_DirectorResolve from
git@github.com:nigoroll/varnish-cache.git - see also
https://github.com/varnishcache/varnish-cache/pull/2680
......@@ -314,42 +314,22 @@ VCL_VOID vmod_cluster_uncacheable_direct(VRT_CTX,
pl->uncacheable_direct = direct;
}
// XXX
#define VDI_HACK 1
static VCL_BACKEND
cluster_resolve(VRT_CTX,
const struct vmod_cluster_cluster_param *pr)
{
VCL_BACKEND obe, r;
#ifdef VDI_HACK
struct busyobj dummy[1];
struct vrt_ctx cctx[1];
#endif
VCL_BACKEND r;
if (pr->uncacheable_direct && ctx->bo &&
(ctx->bo->do_pass || ctx->bo->uncacheable))
return (pr->real);
#ifdef VDI_HACK
if (ctx->bo == NULL) {
INIT_OBJ(dummy, BUSYOBJ_MAGIC);
memcpy(cctx, ctx, sizeof *ctx);
cctx->bo = dummy;
ctx = cctx;
}
#endif
obe = VRT_r_bereq_backend(ctx);
AN(pr->cluster);
VRT_l_bereq_backend(ctx, pr->cluster);
r = VDI_Resolve(ctx);
r = VRT_DirectorResolve(ctx, pr->cluster);
if (cluster_blacklisted(pr, r))
r = pr->real;
VRT_l_bereq_backend(ctx, obe);
return (r);
}
......
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