Changeset 19c6cbe


Ignore:
Timestamp:
10/31/06 17:09:16 (15 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
2f3a25e
Parents:
7d952cb
Message:

Fixed bug where tracesplit and associated tools were not flushing remaining data at the end of their execution.
Resolved warning about unsigned/signed comparison in format_erf.
Added/removed a few newlines over the course of my debugging.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    rd304a7f r19c6cbe  
    698698
    699699        size=ntohs(erfptr->rlen)-(dag_record_size+pad);
    700 
    701700        numbytes=libtrace_io_write(OUTPUT.file, buffer, size);
    702701        if (numbytes != size) {
     
    705704                return -1;
    706705        }
    707 
    708706        return numbytes + pad + dag_record_size;
    709707}
     
    771769        if (payload == NULL) {
    772770                dag_hdr->rlen = htons(dag_record_size + pad);
     771               
    773772        }
    774773       
     
    791790                /* Flags. Can't do this */
    792791                memset(&erfhdr.flags,1,sizeof(erfhdr.flags));
    793                 if (trace_get_direction(packet)!=-1)
     792                if (trace_get_direction(packet)!=~0U)
    794793                        erfhdr.flags.iface = trace_get_direction(packet);
    795794
  • tools/tracesplit/tracesplit.c

    r483abab r19c6cbe  
    99#include <getopt.h>
    1010#include <string.h>
     11#include <assert.h>
    1112
    1213char *strdupcat(char *str,char *app)
     
    121122
    122123        while(1) {
     124               
    123125                if (trace_read_packet(input,packet)<1) {
    124126                        break;
    125127                }
    126 
    127 
     128               
    128129                if (filter && !trace_apply_filter(filter,packet)) {
    129130                        continue;
     
    160161                        totbyteslast=totbytes;
    161162                }
    162 
    163163                if (!output) {
    164164                        char *buffer;
     
    190190                        trace_set_capture_length(packet,trace_get_wire_length(packet));
    191191                }
    192 
     192               
    193193                if (trace_write_packet(output,packet)==-1) {
    194194                        trace_perror_output(output,"write_packet");
    195195                        break;
    196196                }
    197         }
    198 
    199         if (!output)
    200                 trace_destroy_output(output);
     197
     198        }
     199
     200        if (trace_is_err(input)) {
     201                trace_perror(input, "Reading packets");
     202        }
     203       
     204        trace_destroy(input);
     205        trace_destroy_output(output);
    201206
    202207        trace_destroy_packet(packet);
Note: See TracChangeset for help on using the changeset viewer.