[master] b1f659e20 cache_gzip: split out common init code

Nils Goroll nils.goroll at uplex.de
Fri Jul 4 17:04:04 UTC 2025


commit b1f659e20e3e92f1dda92fc4461f8f7130e352eb
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Jan 8 09:50:42 2025 +0100

    cache_gzip: split out common init code

diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 4f7205c92..bb3afcb0f 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -300,15 +300,13 @@ VGZ_Gzip(struct vgz *vg, const void **pptr, ssize_t *plen, enum vgz_flag flags)
  * VDP for gunzip'ing
  */
 
+// common for traditional interface and vdpio
+static int vdp_gunzip_init_common(struct vdp_ctx *vdc);
+
 static int v_matchproto_(vdp_init_f)
 vdp_gunzip_init(VRT_CTX, struct vdp_ctx *vdc, void **priv)
 {
 	struct vgz *vg;
-	struct boc *boc;
-	enum boc_state_e bos;
-	const char *p;
-	ssize_t dl;
-	uint64_t u;
 
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
@@ -326,7 +324,17 @@ vdp_gunzip_init(VRT_CTX, struct vdp_ctx *vdc, void **priv)
 
 	VGZ_Obuf(vg, vg->m_buf, vg->m_sz);
 	*priv = vg;
+	return (vdp_gunzip_init_common(vdc));
+}
 
+static int
+vdp_gunzip_init_common(struct vdp_ctx *vdc)
+{
+	struct boc *boc;
+	enum boc_state_e bos;
+	const char *p;
+	ssize_t dl;
+	uint64_t u;
 	http_Unset(vdc->hp, H_Content_Encoding);
 
 	*vdc->clen = -1;


More information about the varnish-commit mailing list