Don't look at packet or byte limits during the second pass of two-pass analysis.
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Aug 2013 02:19:22 +0000 (02:19 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Aug 2013 02:19:22 +0000 (02:19 +0000)
The limits are enforced during the first pass, and frames that get dropped from
the first pass for this reason aren't available to the second pass at all, so
checking again is redundant.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@51460 f5534014-38df-0310-8fa8-9805f1628bb7

tshark.c

index d256e65cd82744f85ee7bf9aa8cad385002bd69d..78a0e84c42591ada09ec729fe3e6aca394459ce9 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -3048,7 +3048,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
 
   if (perform_two_pass_analysis) {
     frame_data *fdata;
-    int old_max_packet_count = max_packet_count;
 
     /* Allocate a frame_data_sequence for all the frames. */
     cf->frames = new_frame_data_sequence();
@@ -3075,8 +3074,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
      * don't need after the sequential run-through of the packets. */
     postseq_cleanup_all_protocols();
 
-    max_packet_count = old_max_packet_count;
-
     prev_dis = NULL;
     prev_cap = NULL;
     buffer_init(&buf, 1500);
@@ -3117,15 +3114,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
               exit(2);
             }
           }
-          /* Stop reading if we have the maximum number of packets;
-           * When the -c option has not been used, max_packet_count
-           * starts at 0, which practically means, never stop reading.
-           * (unless we roll over max_packet_count ?)
-           */
-          if ( (--max_packet_count == 0) || (max_byte_count != 0 && data_offset >= max_byte_count)) {
-            err = 0; /* This is not an error */
-            break;
-          }
         }
       }
     }