[master] 9a7eb1a Pinpoint sanity-checks of vfp->ctx to only the two place it is still hackishly used.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 3 11:32:47 CEST 2014


commit 9a7eb1a64371cdecd9f1b996b3e1ecaf66bca701
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 3 09:32:15 2014 +0000

    Pinpoint sanity-checks of vfp->ctx to only the two place it is still
    hackishly used.

diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c
index 2963b95..ce76cec 100644
--- a/bin/varnishd/cache/cache_esi_fetch.c
+++ b/bin/varnishd/cache/cache_esi_fetch.c
@@ -65,7 +65,6 @@ vfp_vep_callback(struct vfp_ctx *vc, void *priv, ssize_t l, enum vgz_flag flg)
 	int i;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
-	CHECK_OBJ_NOTNULL(vc->bo, BUSYOBJ_MAGIC);
 	CAST_OBJ_NOTNULL(vef, priv, VEF_MAGIC);
 	assert(l >= 0);
 
@@ -82,6 +81,7 @@ vfp_vep_callback(struct vfp_ctx *vc, void *priv, ssize_t l, enum vgz_flag flg)
 	if (l == 0 && flg == VGZ_NORMAL)
 		return (vef->tot);
 
+	CHECK_OBJ_NOTNULL(vc->bo, BUSYOBJ_MAGIC);
 	VGZ_Ibuf(vef->vgz, vef->ibuf_o, l);
 	do {
 		dl = 0;
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index 0083510..3db8287 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -58,7 +58,6 @@ VFP_Error(struct vfp_ctx *vc, const char *fmt, ...)
 	va_list ap;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
-	assert(vc->bo->state >= BOS_REQ_DONE);
 	if (!vc->failed) {
 		va_start(ap, fmt);
 		VSLbv(vc->vsl, SLT_FetchError, fmt, ap);
@@ -79,7 +78,6 @@ VFP_GetStorage(struct vfp_ctx *vc, ssize_t *sz, uint8_t **ptr)
 	ssize_t l;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
-	CHECK_OBJ_NOTNULL(vc->bo, BUSYOBJ_MAGIC);
 	AN(sz);
 	assert(*sz >= 0);
 	AN(ptr);
diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index e05be30..99fc00f 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -409,6 +409,7 @@ ObjSetattr(const struct vfp_ctx *vc, enum obj_attr attr, ssize_t len,
 	void *retval = NULL;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(vc->bo, BUSYOBJ_MAGIC);
 	CHECK_OBJ_NOTNULL(vc->oc, OBJCORE_MAGIC);
 	o = obj_getobj(vc->oc, vc->stats);
 	CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);



More information about the varnish-commit mailing list