[6.0] 1c7e07f91 Track libz changes
Walid Boudebouda
walid.boudebouda at gmail.com
Wed Dec 10 15:43:07 UTC 2025
commit 1c7e07f910ba045c95a0f9f69edff4fd899561dd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Nov 24 14:00:13 2025 +0000
Track libz changes
diff --git a/lib/libvgz/deflate.c b/lib/libvgz/deflate.c
index 05a2d4517..a3c8935b8 100644
--- a/lib/libvgz/deflate.c
+++ b/lib/libvgz/deflate.c
@@ -1792,8 +1792,10 @@ local block_state deflate_stored(deflate_state *s, int flush) {
s->high_water = s->strstart;
/* If the last block was written to next_out, then done. */
- if (last)
+ if (last) {
+ s->bi_used = 8;
return finish_done;
+ }
/* If flushing and all input has been consumed, then done. */
if (flush != Z_NO_FLUSH && flush != Z_FINISH &&
@@ -1845,6 +1847,8 @@ local block_state deflate_stored(deflate_state *s, int flush) {
}
/* We've done all we can with the available input and output. */
+ if (last)
+ s->bi_used = 8;
return last ? finish_started : need_more;
}
diff --git a/lib/libvgz/zconf.h b/lib/libvgz/zconf.h
index 4a52aed7c..2c7991abf 100644
--- a/lib/libvgz/zconf.h
+++ b/lib/libvgz/zconf.h
@@ -235,10 +235,12 @@
# endif
#endif
-#if defined(ZLIB_CONST) && !defined(z_const)
-# define z_const const
-#else
-# define z_const
+#ifndef z_const
+# ifdef ZLIB_CONST
+# define z_const const
+# else
+# define z_const
+# endif
#endif
#ifdef Z_SOLO
@@ -434,11 +436,11 @@ typedef uLong FAR uLongf;
typedef unsigned long z_crc_t;
#endif
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+#if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
-#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+#if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
diff --git a/lib/libvgz/zutil.h b/lib/libvgz/zutil.h
index c095a04d1..0dfa02357 100644
--- a/lib/libvgz/zutil.h
+++ b/lib/libvgz/zutil.h
@@ -65,7 +65,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* To be used only when the state is known to be valid */
/* common constants */
-
+#if MAX_WBITS < 9 || MAX_WBITS > 15
+# error MAX_WBITS must be in 9..15
+#endif
#ifndef DEF_WBITS
# define DEF_WBITS MAX_WBITS
#endif
More information about the varnish-commit
mailing list