aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-09-29 02:05:09 +0000
committerGuy Harris <guy@alum.mit.edu>2007-09-29 02:05:09 +0000
commit81db68f38f9981f1b669fd5bbcf22268bb96ef3d (patch)
tree2a3ab4bf84eaba14d2018e2e6a52bb7a2fb9b7b7 /tshark.c
parent322d44d416c84ac2ae12dae16b7b5cbf6d33c216 (diff)
Clean up indentation a bit.
Count packets even if we're not dissecting them. svn path=/trunk/; revision=23026
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/tshark.c b/tshark.c
index ecea587a3f..98fc2b7ba5 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1966,22 +1966,28 @@ capture_input_new_packets(capture_options *capture_opts, int to_read)
#endif /* SIGINFO */
if(do_dissection) {
- while (to_read-- && cf->wth) {
- ret = wtap_read(cf->wth, &err, &err_info, &data_offset);
- if(ret == FALSE) {
- /* read from file failed, tell the capture child to stop */
- sync_pipe_stop(capture_opts);
- wtap_close(cf->wth);
- cf->wth = NULL;
- } else {
- ret = process_packet(cf, data_offset, wtap_phdr(cf->wth),
- wtap_pseudoheader(cf->wth), wtap_buf_ptr(cf->wth));
- }
- if (ret != FALSE) {
- /* packet sucessfully read and gone through the "Read Filter" */
- packet_count++;
- }
- }
+ while (to_read-- && cf->wth) {
+ ret = wtap_read(cf->wth, &err, &err_info, &data_offset);
+ if(ret == FALSE) {
+ /* read from file failed, tell the capture child to stop */
+ sync_pipe_stop(capture_opts);
+ wtap_close(cf->wth);
+ cf->wth = NULL;
+ } else {
+ ret = process_packet(cf, data_offset, wtap_phdr(cf->wth),
+ wtap_pseudoheader(cf->wth), wtap_buf_ptr(cf->wth));
+ }
+ if (ret != FALSE) {
+ /* packet sucessfully read and gone through the "Read Filter" */
+ packet_count++;
+ }
+ }
+ } else {
+ /*
+ * Dumpcap's doing all the work; we're not doing any dissection.
+ * Count all the packets it wrote.
+ */
+ packet_count += to_read;
}
if (print_packet_counts) {