aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2010-05-07 19:45:47 +0000
committerGerald Combs <gerald@wireshark.org>2010-05-07 19:45:47 +0000
commit52cbbd605fbe3233ca4ed184ff73d2c3eeb0683a (patch)
tree74bc4f0143830c45b58eaa1820b8db1466c86bd5 /wiretap
parent077ff72ac19c4c48a47f914615f3ddc50b086c72 (diff)
EOF in zlib 1.2.5 seems to be sticky. When we're tailing a file and we
reach EOF, zlib's file handle seems to stay at EOF even when more data is appended to the file. Add a check for 1.2.5 which calls gzseek in order to unset EOF. Fixes bugs 4708 and 4748. svn path=/trunk/; revision=32715
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/wtap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index a1d76d7cd0..f3a12b1432 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -35,6 +35,10 @@
#include <unistd.h>
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
#include "wtap-int.h"
#include "wtap.h"
@@ -646,6 +650,14 @@ wtap_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
*/
wth->phdr.pkt_encap = wth->file_encap;
+#if defined(ZLIB_VERNUM) && ZLIB_VERNUM == 0x1250
+ /* Reset EOF */
+ /* g_log(NULL, G_LOG_LEVEL_DEBUG, "wtap_read: eof before seek: %d", gzeof(wth->fh)); */
+ if (gzeof(wth->fh))
+ gzseek(wth->fh, 0, SEEK_CUR);
+ /* g_log(NULL, G_LOG_LEVEL_DEBUG, "wtap_read: eof after seek: %d", gzeof(wth->fh)); */
+#endif
+
if (!wth->subtype_read(wth, err, err_info, data_offset))
return FALSE; /* failure */