aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-12-02 09:24:55 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-12-02 09:24:55 +0000
commitc85fb9fcb4da5db513669079ef8a752a4dd20d72 (patch)
tree2c5a1b470f971f527d9f979f74a4b91c4a174ff8 /capture_loop.c
parent9edeb85cba277c664936f6b5a153fbe9fda6f204 (diff)
performance improvement: if the packet info dialog is hidden, we don't need to call the capture_... packet count functions
svn path=/trunk/; revision=16647
Diffstat (limited to 'capture_loop.c')
-rw-r--r--capture_loop.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/capture_loop.c b/capture_loop.c
index 2ef66b06d2..fa01efd8a2 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -141,6 +141,7 @@ typedef struct _loop_data {
gint packets_max; /* Number of packets we're supposed to capture - 0 means infinite */
gint packets_sync_pipe; /* packets not already send out to the sync_pipe */
packet_counts counts; /* several packet type counters */
+ gboolean show_info; /* show(hide) capture info dialog */
/* pcap "input file" */
pcap_t *pcap_h; /* pcap handle */
@@ -1206,6 +1207,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
#ifdef MUST_DO_SELECT
ld.pcap_fd = 0;
#endif
+ ld.show_info = capture_opts->show_info;
#ifndef _WIN32
/*
@@ -1659,6 +1661,11 @@ capture_loop_packet_cb(u_char *user, const struct pcap_pkthdr *phdr,
}
#ifndef DUMPCAP
+ /* if the capture info dialog is hidden, no need to create the packet info */
+ if(!ld->show_info) {
+ return;
+ }
+
switch (ld->wtap_linktype) {
case WTAP_ENCAP_ETHERNET:
capture_eth(pd, 0, whdr.caplen, &ld->counts);