Ignore:
Timestamp:
11/03/05 14:25:46 (8 years ago)
Author:
perry
Message:

Don't read the packet past EOF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/tracertstats/tracertstats.c

    r407 r491  
    9595        uint64_t bytes = 0; 
    9696        double last_ts = 0; 
     97        double ts = 0; 
    9798 
    9899        output=output_init(uri,output_format?:"csv"); 
     
    117118                        break; 
    118119                } 
     120                ts = trace_get_seconds(&packet); 
    119121 
    120122                for(i=0;i<filter_count;++i) { 
     
    129131 
    130132                if (packet_interval!=UINT64_MAX 
    131                   &&(last_ts==0 || last_ts<trace_get_seconds(&packet))) { 
     133                  &&(last_ts==0 || last_ts<ts)) { 
    132134                        if (last_ts==0) 
    133                                 last_ts=trace_get_seconds(&packet); 
    134                         report_results(trace_get_seconds(&packet),count,bytes); 
     135                                last_ts=ts; 
     136                        report_results(ts,count,bytes); 
    135137                        count=0; 
    136138                        bytes=0; 
     
    139141 
    140142                if (count > packet_count) { 
    141                         report_results(trace_get_seconds(&packet),count,bytes); 
     143                        report_results(ts,count,bytes); 
    142144                        count=0; 
    143145                        bytes=0; 
    144146                } 
    145147        } 
    146         report_results(trace_get_seconds(&packet),count,bytes); 
     148        report_results(ts,count,bytes); 
    147149 
    148150        trace_destroy(trace); 
Note: See TracChangeset for help on using the changeset viewer.