Changeset 24ca459


Ignore:
Timestamp:
09/16/11 10:13:25 (9 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:
f258932
Parents:
204872da
Message:
  • Why not cache the capture length when we first read the packet, seeing as we had to look it up then anyway?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapfile.c

    r5f329ab r24ca459  
    137137
    138138
    139 static uint16_t swaps(libtrace_t *libtrace, uint16_t num)
     139static inline uint16_t swaps(libtrace_t *libtrace, uint16_t num)
    140140{
    141141        /* To deal with open_dead traces that might try and use this
     
    152152}
    153153
    154 static uint32_t swapl(libtrace_t *libtrace, uint32_t num)
     154static inline uint32_t swapl(libtrace_t *libtrace, uint32_t num)
    155155{
    156156        /* To deal with open_dead traces that might try and use this
     
    380380                return -1;
    381381        }
    382        
     382
     383        /* We may as well cache this value now, seeing as we already had to
     384         * look it up */
     385        packet->capture_length = bytes_to_read;
    383386        return sizeof(libtrace_pcapfile_pkt_hdr_t) + bytes_to_read;
    384387}
Note: See TracChangeset for help on using the changeset viewer.