[master] d8a627ec1 Clarify VFP_NULL semantics

Nils Goroll nils.goroll at uplex.de
Sun May 29 12:29:07 UTC 2022


commit d8a627ec138c838a2e7e96318a5b8569e1e65d61
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun May 29 14:28:07 2022 +0200

    Clarify VFP_NULL semantics

diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index ed7fbea59..150b473f9 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -201,6 +201,7 @@ VFP_Suck(struct vfp_ctx *vc, void *p, ssize_t *lp)
 		vp = vfe->closed;
 	}
 	vc->vfp_nxt = vfe;
+	assert(vp != VFP_NULL);
 	return (vp);
 }
 
diff --git a/bin/varnishd/cache/cache_filter.h b/bin/varnishd/cache/cache_filter.h
index 2b262d1eb..13fa35bcd 100644
--- a/bin/varnishd/cache/cache_filter.h
+++ b/bin/varnishd/cache/cache_filter.h
@@ -40,7 +40,7 @@ enum vfp_status {
 	VFP_ERROR = -1,
 	VFP_OK = 0,
 	VFP_END = 1,
-	VFP_NULL = 2,
+	VFP_NULL = 2,	// signal bypass, never returned by VFP_Suck()
 };
 
 typedef enum vfp_status vfp_init_f(VRT_CTX, struct vfp_ctx *,


More information about the varnish-commit mailing list