From 11c86ec476f363c8e8eac9ccc7e827a3c92943c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=BCxen?= Date: Wed, 25 Jul 2012 07:08:20 +0000 Subject: Update recv/drop counters also when no threads are used. This should fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7523 svn path=/trunk/; revision=43981 --- dumpcap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dumpcap.c b/dumpcap.c index c78d239550..5684cc3a4e 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -3934,8 +3934,10 @@ capture_loop_write_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr /* We may be called multiple times from pcap_dispatch(); if we've set the "stop capturing" flag, ignore this packet, as we're not supposed to be saving any more packets. */ - if (!global_ld.go) + if (!global_ld.go) { + pcap_opts->dropped++; return; + } if (global_ld.pdh) { gboolean successful; @@ -3951,11 +3953,13 @@ capture_loop_write_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr if (!successful) { global_ld.go = FALSE; global_ld.err = err; + pcap_opts->dropped++; } else { g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Wrote a packet of length %d captured on interface %u.", phdr->caplen, pcap_opts->interface_id); global_ld.packet_count++; + pcap_opts->received++; /* if the user told us to stop after x packets, do we already have enough? */ if ((global_ld.packet_max > 0) && (global_ld.packet_count >= global_ld.packet_max)) { global_ld.go = FALSE; -- cgit v1.2.3