Adjust to varnish-cache 7.1 and later

parent 0447b8e9
......@@ -64,7 +64,9 @@ Implementation note:
INSTALLING
==========
This vmod is supported for varnish 6.3 and later.
This vmod is supported for varnish 7.1 and later.
Branches exist for older versions.
Building from source
--------------------
......
......@@ -51,10 +51,11 @@ const char const placeholder[] =
const size_t placeholder_l = sizeof(placeholder) - 1;
static enum vfp_status
vfp_etag_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
vfp_etag_init(VRT_CTX, struct vfp_ctx *vc, struct vfp_entry *vfe)
{
struct etag *bh = NULL;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vfe, VFP_ENTRY_MAGIC);
......
......@@ -9,12 +9,19 @@
int
vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
{
const char *err;
switch (e) {
case VCL_EVENT_LOAD:
VRT_AddVFP(ctx, &VFP_etag);
err = VRT_AddFilter(ctx, &VFP_etag, NULL);
if (err != NULL) {
VRT_fail(ctx, "Adding etag filter failed: %s",
err);
return (1);
}
break;
case VCL_EVENT_DISCARD:
VRT_RemoveVFP(ctx, &VFP_etag);
VRT_RemoveFilter(ctx, &VFP_etag, NULL);
break;
default:
break;
......
......@@ -74,7 +74,9 @@ Implementation note:
INSTALLING
==========
This vmod is supported for varnish 6.3 and later.
This vmod is supported for varnish 7.1 and later.
Branches exist for older versions.
Building from source
--------------------
......
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