summaryrefslogtreecommitdiff
path: root/ui/gtk/main_statusbar.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-06 12:14:25 -0700
committerGuy Harris <guy@alum.mit.edu>2015-04-06 19:15:24 +0000
commit1871fb2b0d9628707661776cfa1b35f210e5e58e (patch)
tree36a23e755ae887fb26e47af67645b2ac454ca32e /ui/gtk/main_statusbar.c
parentb23ab904e728022340f139701626a06851562b1d (diff)
downloadwireshark-1871fb2b0d9628707661776cfa1b35f210e5e58e.tar.gz
Keep a captured-packet count in a capture_session and use that.
Have the count in a cfile_t structure always reflect the actual number of packets that have been read from the file, rather than, when doing a non-update-list-of-packets-in-real-time capture, falsely increasing the count in the cfile_t to reflect the number of packets captured but not yet read. Have the status bar base its captured-packet count on the count in the capture_session structure, and base the "sorry, no packets were captured" message on the count in the capture_session structure, as we're no longer using the count in the cfile_t structure to count anything in the process of a non-update-list-of-packets-in-real-time capture. That way, we preserve the invariant that the "frames" member of a cfile_t will be non-null if the "count" member is non-zero, fixing bug 6217. It also means we can get rid of cf_set_packet_count(), as we only set the count in the capture-file-reading code. Bug: 6217 Change-Id: I72c0e2c07c30782bad777995370b7c19e1460cc2 Reviewed-on: https://code.wireshark.org/review/7950 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/main_statusbar.c')
-rw-r--r--ui/gtk/main_statusbar.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/gtk/main_statusbar.c b/ui/gtk/main_statusbar.c
index 44cd1207bd..3ff7e62291 100644
--- a/ui/gtk/main_statusbar.c
+++ b/ui/gtk/main_statusbar.c
@@ -900,12 +900,10 @@ statusbar_capture_fixed_started_cb(capture_session *cap_session)
static void
statusbar_capture_fixed_continue_cb(capture_session *cap_session)
{
- capture_file *cf = (capture_file *)cap_session->cf;
gchar *capture_msg;
-
gtk_statusbar_pop(GTK_STATUSBAR(packets_bar), packets_ctx);
- capture_msg = g_strdup_printf(" Packets: %u", cf_get_packet_count(cf));
+ capture_msg = g_strdup_printf(" Packets: %u", cap_session->count);
gtk_statusbar_push(GTK_STATUSBAR(packets_bar), packets_ctx, capture_msg);
g_free(capture_msg);
}