Commit 8a971aae authored by Nils Goroll's avatar Nils Goroll

hack around the vdp bug in 6.2.0

parent b7779f71
......@@ -14,6 +14,7 @@ AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_CC_STDC
if test "x$ac_cv_prog_cc_c99" = xno; then
......
......@@ -353,9 +353,23 @@ vmod_version(VRT_CTX)
return VERSION;
}
struct vfilter {
unsigned magic;
#define VFILTER_MAGIC 0xd40894e9
const struct vfp *vfp;
const struct vdp *vdp;
const char *name;
int nlen;
VTAILQ_ENTRY(vfilter) list;
};
#include "cache/cache_vcl.h"
int v_matchproto_(vmod_event_f)
vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
{
struct vfilter *vp;
ASSERT_CLI();
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
AN(priv);
......@@ -377,9 +391,24 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
}
VRT_AddVDP(ctx, &VDP_pesi);
VRT_AddVFP(ctx, (const struct vfp *)&VDP_pesi);
VTAILQ_FOREACH(vp, &ctx->vcl->vfps, list) {
if (vp->vfp != (const struct vfp *)&VDP_pesi)
continue;
vp->vdp = &VDP_pesi;
vp->vfp = NULL;
}
break;
case VCL_EVENT_DISCARD:
VRT_RemoveVDP(ctx, &VDP_pesi);
VTAILQ_FOREACH(vp, &ctx->vcl->vfps, list) {
if (vp->vdp != &VDP_pesi)
continue;
vp->vdp = NULL;
vp->vfp = (const struct vfp *)&VDP_pesi;
}
VRT_RemoveVFP(ctx, (const struct vfp *)&VDP_pesi);
AN(loadcnt);
if (--loadcnt == 0) {
......
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