aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2011-04-27 09:20:02 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2011-04-27 09:20:02 +0000
commit192837a1f215d3cb9a037c674c81af0c4fa815dc (patch)
treec0df8d895d27092e3838441aee4bd08b265fc0ba /file.c
parent110e5961bb40f3a35da8c617dc4c50952120de17 (diff)
Restore updating packet bar while loading file (removed in r36851)
svn path=/trunk/; revision=36896
Diffstat (limited to 'file.c')
-rw-r--r--file.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/file.c b/file.c
index 9e606918b6..8016c7a477 100644
--- a/file.c
+++ b/file.c
@@ -509,6 +509,9 @@ cf_read(capture_file *cf, gboolean from_save)
gboolean filtering_tap_listeners;
guint tap_flags;
volatile int count = 0;
+#ifdef HAVE_LIBPCAP
+ volatile int displayed_once = 0;
+#endif
gboolean compiled;
/* Compile the current display filter.
@@ -579,6 +582,15 @@ cf_read(capture_file *cf, gboolean from_save)
if (data_offset >= progbar_nextstep) {
if (progbar != NULL) {
progbar_val = calc_progbar_val(cf, size, data_offset, status_str, sizeof(status_str));
+ /* update the packet bar content on the first run or frequently on very large files */
+#ifdef HAVE_LIBPCAP
+ if (progbar_quantum > 500000 || displayed_once == 0) {
+ if ((auto_scroll_live || displayed_once == 0 || cf->displayed_count < 1000) && cf->count != 0) {
+ displayed_once = 1;
+ packets_bar_update();
+ }
+ }
+#endif /* HAVE_LIBPCAP */
update_progress_dlg(progbar, progbar_val, status_str);
}
progbar_nextstep += progbar_quantum;