[master] 068412d Add a VGZ_ObufFull() function

Poul-Henning Kamp phk at varnish-cache.org
Thu Jan 27 19:19:30 CET 2011


commit 068412de9a427229879e553b23052650f997333b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jan 27 18:17:57 2011 +0000

    Add a VGZ_ObufFull() function

diff --git a/bin/varnishd/cache.h b/bin/varnishd/cache.h
index 9116946..980ab6f 100644
--- a/bin/varnishd/cache.h
+++ b/bin/varnishd/cache.h
@@ -643,6 +643,7 @@ struct vgz *VGZ_NewGzip(struct sess *sp);
 void VGZ_Ibuf(struct vgz *, const void *, ssize_t len);
 int VGZ_IbufEmpty(const struct vgz *vg);
 void VGZ_Obuf(struct vgz *, const void *, ssize_t len);
+int VGZ_ObufFull(const struct vgz *vg);
 int VGZ_ObufStorage(const struct sess *sp, struct vgz *vg);
 int VGZ_Gzip(struct vgz *, const void **, size_t *len, enum vgz_flag);
 int VGZ_Gunzip(struct vgz *, const void **, size_t *len);
diff --git a/bin/varnishd/cache_gzip.c b/bin/varnishd/cache_gzip.c
index 930d7f1..5177d01 100644
--- a/bin/varnishd/cache_gzip.c
+++ b/bin/varnishd/cache_gzip.c
@@ -235,6 +235,14 @@ VGZ_Obuf(struct vgz *vg, const void *ptr, ssize_t len)
 	vg->vz.avail_out = len;
 }
 
+int
+VGZ_ObufFull(const struct vgz *vg)
+{
+
+	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
+	return (vg->vz.avail_out == 0);
+}
+
 /*--------------------------------------------------------------------
  * Keep the outbuffer supplied with storage and file it under the
  * sp->obj as it fills.



More information about the varnish-commit mailing list