Add vrt_priv fini method

parent 1b0c62fe
...@@ -98,6 +98,12 @@ priv_vcl_free(void *priv) ...@@ -98,6 +98,12 @@ priv_vcl_free(void *priv)
AZ(wa_vcl); AZ(wa_vcl);
} }
static const struct vmod_priv_methods priv_vcl_methods[1] = {{
.magic = VMOD_PRIV_METHODS_MAGIC,
.type = "vmod_weightadjust_priv_vcl",
.fini = priv_vcl_free
}};
int int
vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
{ {
...@@ -111,7 +117,7 @@ vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -111,7 +117,7 @@ vmod_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VTAILQ_INIT(&wa_vcl->props); VTAILQ_INIT(&wa_vcl->props);
AZ(pthread_mutex_init(&wa_vcl->mtx, NULL)); AZ(pthread_mutex_init(&wa_vcl->mtx, NULL));
priv->priv = wa_vcl; priv->priv = wa_vcl;
priv->free = priv_vcl_free; priv->methods = priv_vcl_methods;
break; break;
case VCL_EVENT_DISCARD: case VCL_EVENT_DISCARD:
case VCL_EVENT_WARM: case VCL_EVENT_WARM:
......
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