From e09e2c27ab9ed0ac7c7d1bc21d8e693f97103f88 Mon Sep 17 00:00:00 2001 From: ulfl Date: Sun, 22 Jan 2006 16:26:41 +0000 Subject: show the number of packets captured, if "Update list of packets ..." isn't used git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17071 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'capture.c') diff --git a/capture.c b/capture.c index 4cfb3fc4b7..96cc745e74 100644 --- a/capture.c +++ b/capture.c @@ -217,7 +217,7 @@ guint32 drops) } /* if we didn't captured even a single packet, close the file again */ - if(cf_packet_count(capture_opts->cf) == 0 && !capture_opts->restart) { + if(cf_get_packet_count(capture_opts->cf) == 0 && !capture_opts->restart) { simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK, "%sNo packets captured!%s\n" "\n" @@ -327,9 +327,6 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) XXX - abort on a read error? */ cf_callback_invoke(cf_cb_live_capture_update_continue, capture_opts->cf); - - /* update the main window, so we get events (e.g. from the stop toolbar button) */ - main_window_update(); break; case CF_READ_ABORTED: @@ -338,8 +335,17 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) capture_kill_child(capture_opts); break; } + } else { + /* increase capture file packet counter by the number or incoming packets */ + cf_set_packet_count(capture_opts->cf, + cf_get_packet_count(capture_opts->cf) + to_read); + + cf_callback_invoke(cf_cb_live_capture_fixed_continue, capture_opts->cf); } + /* update the main window, so we get events (e.g. from the stop toolbar button) */ + main_window_update(); + if(capture_opts->show_info) capture_info_new_packets(to_read); } @@ -408,7 +414,7 @@ capture_input_closed(capture_options *capture_opts) switch (status) { case CF_READ_OK: - if(cf_packet_count(capture_opts->cf) == 0 && !capture_opts->restart) { + if(cf_get_packet_count(capture_opts->cf) == 0 && !capture_opts->restart) { simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK, "%sNo packets captured!%s\n" "\n" -- cgit v1.2.3