forked from osmocom/wireshark
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
This commit is contained in:
parent
d14fa0eb0f
commit
11c86ec476
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue