adjust to proposed vdp/vfp api changes

Ref https://github.com/varnishcache/varnish-cache/pull/3287
parent e60cb05b
Pipeline #470 failed with stages
......@@ -313,7 +313,7 @@ vfp_br_init(struct vfp_ctx *ctx, struct vfp_entry *ent)
CHECK_OBJ_NOTNULL(ctx, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ent, VFP_ENTRY_MAGIC);
AN(ent->vfp);
CAST_OBJ_NOTNULL(priv, ent->vfp->priv1, VFP_PRIV_MAGIC);
CAST_OBJ_NOTNULL(priv, ent->vfp->vfp_priv, VFP_PRIV_MAGIC);
CHECK_OBJ_NOTNULL(priv->settings, VBR_SETTINGS_MAGIC);
settings = priv->settings;
......@@ -368,7 +368,7 @@ vfp_br_fini(struct vfp_ctx *ctx, struct vfp_entry *ent)
CHECK_OBJ_NOTNULL(ctx, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ent, VFP_ENTRY_MAGIC);
AN(ent->vfp);
CAST_OBJ_NOTNULL(priv, ent->vfp->priv1, VFP_PRIV_MAGIC);
CAST_OBJ_NOTNULL(priv, ent->vfp->vfp_priv, VFP_PRIV_MAGIC);
if (ent->priv1 != NULL) {
CAST_OBJ(vbr, ent->priv1, VBR_MAGIC);
......@@ -396,7 +396,7 @@ vfp_br_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
CHECK_OBJ_NOTNULL(ent, VFP_ENTRY_MAGIC);
CAST_OBJ_NOTNULL(vbr, ent->priv1, VBR_MAGIC);
AN(ent->vfp);
CAST_OBJ_NOTNULL(priv, ent->vfp->priv1, VFP_PRIV_MAGIC);
CAST_OBJ_NOTNULL(priv, ent->vfp->vfp_priv, VFP_PRIV_MAGIC);
assert(vbr->which == ENC);
AN(ptr);
AN(lenp);
......@@ -452,7 +452,7 @@ vfp_unbr_pull(struct vfp_ctx *ctx, struct vfp_entry *ent, void *ptr,
CHECK_OBJ_NOTNULL(ent, VFP_ENTRY_MAGIC);
CAST_OBJ_NOTNULL(vbr, ent->priv1, VBR_MAGIC);
AN(ent->vfp);
CAST_OBJ_NOTNULL(priv, ent->vfp->priv1, VFP_PRIV_MAGIC);
CAST_OBJ_NOTNULL(priv, ent->vfp->vfp_priv, VFP_PRIV_MAGIC);
assert(vbr->which == DEC);
AN(ptr);
AN(lenp);
......@@ -533,7 +533,7 @@ static const struct vfp vfp_br = {
.init = vfp_br_init,
.pull = vfp_br_pull,
.fini = vfp_br_fini,
.priv1 = &default_encoder,
.vfp_priv = &default_encoder,
};
static const struct vfp vfp_unbr = {
......@@ -541,7 +541,7 @@ static const struct vfp vfp_unbr = {
.init = vfp_br_init,
.pull = vfp_unbr_pull,
.fini = vfp_br_fini,
.priv1 = &default_decoder,
.vfp_priv = &default_decoder,
};
/* Event function */
......@@ -580,13 +580,13 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case VCL_EVENT_LOAD:
VRT_AddVFP(ctx, &vfp_br);
VRT_AddVFP(ctx, &vfp_unbr);
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp_br.priv1),
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp_br.vfp_priv),
VFP_PRIV_MAGIC);
if (vfp_priv->stats == NULL)
vfp_priv->stats = VSC_brotli_New(NULL,
&vfp_priv->vsc_seg,
"br");
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp_unbr.priv1),
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp_unbr.vfp_priv),
VFP_PRIV_MAGIC);
if (vfp_priv->stats == NULL)
vfp_priv->stats = VSC_brotli_New(NULL,
......@@ -600,9 +600,9 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
vfpe = VSLIST_FIRST(vfph);
CHECK_OBJ_NOTNULL(vfpe, CUSTOM_VFP_MAGIC);
if (vfpe->vfp != NULL) {
if (vfpe->vfp->priv1 != NULL) {
if (vfpe->vfp->vfp_priv != NULL) {
CAST_OBJ(vfp_priv,
TRUST_ME(vfpe->vfp->priv1),
TRUST_ME(vfpe->vfp->vfp_priv),
VFP_PRIV_MAGIC);
if (vfp_priv->settings != NULL) {
CHECK_OBJ(vfp_priv->settings,
......@@ -625,8 +625,8 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case VCL_EVENT_WARM:
VSLIST_FOREACH(vfpe, vfph, list) {
CHECK_OBJ_NOTNULL(vfpe, CUSTOM_VFP_MAGIC);
if (vfpe->vfp != NULL && vfpe->vfp->priv1 != NULL) {
CAST_OBJ(vfp_priv, TRUST_ME(vfpe->vfp->priv1),
if (vfpe->vfp != NULL && vfpe->vfp->vfp_priv != NULL) {
CAST_OBJ(vfp_priv, TRUST_ME(vfpe->vfp->vfp_priv),
VFP_PRIV_MAGIC);
if (vfp_priv->vsc_seg != NULL)
VRT_VSC_Reveal(vfp_priv->vsc_seg);
......@@ -636,8 +636,8 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case VCL_EVENT_COLD:
VSLIST_FOREACH(vfpe, vfph, list) {
CHECK_OBJ_NOTNULL(vfpe, CUSTOM_VFP_MAGIC);
if (vfpe->vfp != NULL && vfpe->vfp->priv1 != NULL) {
CAST_OBJ(vfp_priv, TRUST_ME(vfpe->vfp->priv1),
if (vfpe->vfp != NULL && vfpe->vfp->vfp_priv != NULL) {
CAST_OBJ(vfp_priv, TRUST_ME(vfpe->vfp->vfp_priv),
VFP_PRIV_MAGIC);
if (vfp_priv->vsc_seg != NULL)
VRT_VSC_Hide(vfp_priv->vsc_seg);
......@@ -732,7 +732,7 @@ coder_init(VRT_CTX, const char *vcl_name, struct vmod_priv *priv,
vfp->name = strdup(filter_name);
vfp->init = vfp_br_init;
vfp->fini = vfp_br_fini;
vfp->priv1 = vfp_priv;
vfp->vfp_priv = vfp_priv;
vfph = init_priv_vcl(priv);
vfpe->vfp = vfp;
......@@ -754,7 +754,7 @@ create_stats(VRT_CTX, const struct vfp *vfp, const char *vcl_name)
}
AN(vfp);
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp->priv1), VFP_PRIV_MAGIC);
CAST_OBJ_NOTNULL(vfp_priv, TRUST_ME(vfp->vfp_priv), VFP_PRIV_MAGIC);
vfp_priv->stats = VSC_brotli_New(NULL, &vfp_priv->vsc_seg, "%s.%s",
VCL_Name(ctx->vcl), vcl_name);
......
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