Unverified Commit 132b022a authored by Nils Goroll's avatar Nils Goroll

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