TSIOBUFFERREADER(3ts) | Apache Traffic Server | TSIOBUFFERREADER(3ts) |
TSIOBufferReader - traffic Server IO buffer reader API
#include <ts/ts.h>
data is the data in the TSIOBufferBlock and is nbytes long. context is opaque data provided to the API call along with this function and passed on to the function. This function should return true to continue iteration or false to terminate iteration.
TSIOBufferReader is an read accessor for TSIOBuffer. It represents a location in the contents of the buffer. A buffer can have multiple readers and each reader consumes data in the buffer independently. Data which for which there are no readers is discarded from the buffer. This has two very important consequences --
A buffer has a fixed amount of possible readers (currently 5) which is determined at compile time. Reader allocation is fast and cheap until this maximum is reached at which point it fails.
TSIOBufferReaderClone() allocates a reader and sets its position in the buffer to be the same as reader.
TSIOBufferReaderStart() returns the IO buffer block containing the position of reader.
NOTE:
TSIOBufferReaderIterate() iterates over the blocks for reader. For each block func is called with with the data for the block and context. The context is an opaque type to this function and is passed unchanged to func. It is intended to be used as context for func. If func returns false the iteration terminates. If func returns true the block is consumed. The return value for TSIOBufferReaderIterate() is the return value from the last call to func.
NOTE:
NOTE:
2023, dev@trafficserver.apache.org
November 2, 2023 | 8.1 |