Update recv/drop counters also when no threads are used.

This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7523


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43981 f5534014-38df-0310-8fa8-9805f1628bb7
This commit is contained in:
tuexen 2012-07-25 07:08:20 +00:00
parent 6ab545b87f
commit b90b12b1c8
1 changed files with 5 additions and 1 deletions

View File

@ -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;