Changeset 5798dc6 for lib/format_dag25.c
- Timestamp:
- 09/05/07 10:18:58 (15 years ago)
- 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:
- 9c6005f
- Parents:
- 52656ed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_dag25.c
r52656ed r5798dc6 78 78 uint8_t *bottom; 79 79 uint8_t *top; 80 uint32_t processed; 80 81 }; 81 82 … … 177 178 bottom -= diff; 178 179 } while (diff != 0); 179 180 FORMAT_DATA->top = NULL; 181 FORMAT_DATA->bottom = NULL; 182 FORMAT_DATA->processed = 0; 183 180 184 return 0; 181 185 } … … 239 243 static int dag_available(libtrace_t *libtrace) { 240 244 uint32_t diff = FORMAT_DATA->top - FORMAT_DATA->bottom; 241 if (diff >= dag_record_size) 245 /* If we've processed more than 4MB of data since we last called 246 * dag_advance_stream, then we should call it again to allow the 247 * space occupied by that 4MB to be released */ 248 if (diff >= dag_record_size && FORMAT_DATA->processed < 4 * 1024 * 1024) 242 249 return diff; 243 250 FORMAT_DATA->top = dag_advance_stream(FORMAT_DATA->fd, … … 248 255 return -1; 249 256 } 257 FORMAT_DATA->processed = 0; 250 258 diff = FORMAT_DATA->top - FORMAT_DATA->bottom; 251 259 return diff; … … 264 272 return NULL; 265 273 FORMAT_DATA->bottom += size; 274 FORMAT_DATA->processed += size; 266 275 return erfptr; 267 276 }
Note: See TracChangeset
for help on using the changeset viewer.