Ignore:
Timestamp:
06/28/07 15:43:40 (6 years ago)
Author:
spa1
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
  • trunk/lib/format_legacy.c

    r1239 r1242  
    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.