Commit c984e5d3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Look for VFP's also on the per-vcl list

parent ad69f04e
......@@ -606,7 +606,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
}
if (bo->filter_list == NULL ||
VCL_StackVFP(bo->vfc, bo->filter_list)) {
VCL_StackVFP(bo->vfc, bo->vcl, bo->filter_list)) {
(bo)->htc->doclose = SC_OVERLOAD;
VDI_Finish((bo)->wrk, bo);
return (F_STP_ERROR);
......
......@@ -407,7 +407,7 @@ int VCL_IterDirector(struct cli *, const char *, vcl_be_func *, void *);
/* cache_vcl_vrt.c */
void VCL_VRT_Init(void);
int VCL_StackVFP(struct vfp_ctx *, const char *);
int VCL_StackVFP(struct vfp_ctx *, const struct vcl *, const char *);
/* cache_vrt.c */
void VRTPRIV_init(struct vrt_privs *privs);
......
......@@ -470,7 +470,7 @@ VRT_RemoveVFP(VRT_CTX, const struct vfp *filter)
}
int
VCL_StackVFP(struct vfp_ctx *vc, const char *fl)
VCL_StackVFP(struct vfp_ctx *vc, const struct vcl *vcl, const char *fl)
{
const char *p, *q;
const struct vfp_filter *vp;
......@@ -491,6 +491,14 @@ VCL_StackVFP(struct vfp_ctx *vc, const char *fl)
if (!memcmp(p, vp->filter->name, vp->nlen))
break;
}
if (vp == NULL) {
VTAILQ_FOREACH(vp, &vcl->vfps, list) {
if (vp->nlen != q - p)
continue;
if (!memcmp(p, vp->filter->name, vp->nlen))
break;
}
}
if (vp == NULL)
return (VFP_Error(vc,
"Filter '%.*s' not found", (int)(q-p), p));
......
varnishtest "VMOD vfp"
server s1 {
rxreq
txresp -body "Ponto Facto, Caesar Transit!"
} -start
varnish v1 -vcl+backend {
import debug;
sub vcl_backend_response {
set beresp.filters = "rot13";
}
} -start
client c1 {
txreq
rxresp
expect resp.body == "Cbagb Snpgb, Pnrfne Genafvg!"
} -run
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