Ignore:
Timestamp:
06/28/07 15:43:40 (14 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:
1344aa8
Parents:
0c47bf4
Message:
  • Added format for Auckland VII-style ATM header captures
  • Fixed bug in format_legacy where a non-64 byte record would cause an assert fail - it will now keep trying to read until it gets a 64 byte record or reaches EOF.
  • trace_copy_packet was not initializing the cached values sensibly which was wreaking havoc - this is now fixed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_legacy.c

    r954a329 re1fdc05  
    132132                        assert(0);
    133133        }
    134        
    135         if ((numbytes=libtrace_io_read(INPUT.file,
    136                                         buffer,
    137                                         (size_t)64)) != 64) {
    138                 if (numbytes!=0) {
    139                         trace_set_err(libtrace,errno,"read(%s)",libtrace->uridata);
     134
     135        /* This is going to block until we either get an entire record
     136         * or we reach the end of the file */
     137        while (1) {
     138       
     139                if ((numbytes=libtrace_io_read(INPUT.file,
     140                                                buffer,
     141                                                (size_t)64)) != 64) {
     142                        if (numbytes < 0) {
     143                                trace_set_err(libtrace,errno,"read(%s)",libtrace->uridata);
     144                        } else if (numbytes > 0) {
     145                               
     146                                continue;
     147                        }
     148                        return numbytes;
    140149                }
    141                 return numbytes;
     150                break;
    142151        }
    143152       
Note: See TracChangeset for help on using the changeset viewer.