aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2024-08-12 09:39:43 -0400
committerJohn Thacker <johnthacker@gmail.com>2024-08-12 09:42:01 -0400
commiteef6e3c5b5ed15cc26ee7477738eeba733a96f8b (patch)
tree4a3fbeab52537b683d4bec6a22ce5e648d45703c /wiretap
parent8ab7f82f04b5bc651650c5d872debcb6371d6a6f (diff)
wiretap: reset fast seek with either zlib or zlib-ng
In practice, I don't believe this matters, because we always read through the file sequentially once and only add fast seek points during that initial read. This code from zlib is for when a seek happens during a time when you might still be adding fast seek points.
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file_wrappers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index 69f61eaadc..575d108acb 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -408,15 +408,16 @@ fast_seek_reset(FILE_T state)
break;
case ZLIB:
-#ifdef HAVE_ZLIB
+#ifdef USE_ZLIB_OR_ZLIBNG
if (state->fast_seek_cur != NULL) {
struct zlib_cur_seek_point *cur = (struct zlib_cur_seek_point *) state->fast_seek_cur;
cur->have = 0;
}
#else
- /* Fail if we don't have zlibng, as that shouldn't happen? */
-#endif /* HAVE_ZLIB */
+ /* This "cannot happen" */
+ ws_assert_not_reached();
+#endif /* USE_ZLIB_OR_ZLIBNG */
break;
case GZIP_AFTER_HEADER: