On 02/01/2012, at 11:30 AM, Brian Geffon wrote: > I think you might want TSIOBufferBlockReadAvail and not TSIOBufferReaderAvail.
Hmm, so my code is assuming that all the data is in the first buffer block. It sounds like that it not guaranteed and that I ought to be calling TSIOBufferBlockNext() if the first buffer block doesn't have all the data. thanks, James > > Brian > ________________________________________ > From: James Peach [jamespe...@me.com] > Sent: Saturday, December 31, 2011 10:07 PM > To: dev@trafficserver.apache.org > Subject: inconsistent read IOBuffer results > > Hi all, > > In my proxy code, I have something that looks roughly like this: > > if (TSIOBufferReaderAvail(reader) >= 10) { > blk = TSIOBufferStart(buffer); > ptr = (const uint8_t *)TSIOBufferBlockReadStart(blk, reader, > &nbytes); > > TSReleaseAssert(nbytes >= 10); > } > > Occasionally, the assertion will trigger; is that something that I should > expect and handle? > > cheers, > James