Re: inconsistent read IOBuffer results

2012-01-03 Thread James Peach
get a new empty block. I switched to TSIOBufferReaderStart() and haven't been able to repro yet ... very promising! thanks, James > > > Brian > > > From: James Peach [jamespe...@me.com] > Sent: Monday, January 02, 2012 6:47 PM

RE: inconsistent read IOBuffer results

2012-01-03 Thread Brian Geffon
__ From: James Peach [jamespe...@me.com] Sent: Monday, January 02, 2012 6:47 PM To: dev@trafficserver.apache.org Subject: Re: inconsistent read IOBuffer results On 02/01/2012, at 6:13 PM, Brian Geffon wrote: > My last email was incorrect, it will correctly re

Re: inconsistent read IOBuffer results

2012-01-02 Thread James Peach
On 02/01/2012, at 6:13 PM, Brian Geffon wrote: > My last email was incorrect, it will correctly return the pointer to the > memory of the block, but avail will not be touched and you will have no > idea how much data could have been read. You actually don't even need to > call TSIOBufferBlockReadS

Re: inconsistent read IOBuffer results

2012-01-02 Thread James Peach
On 02/01/2012, at 6:04 PM, Brian Geffon wrote: > I dont think this is a bug, your usage of TSIOBufferBlockReadStart() > is incorrect. The third parameter which you call nbytes is set to the > number of bytes remaining in the buffer block after the read. Since > you're setting it to zero before the

Re: inconsistent read IOBuffer results

2012-01-02 Thread Brian Geffon
My last email was incorrect, it will correctly return the pointer to the memory of the block, but avail will not be touched and you will have no idea how much data could have been read. You actually don't even need to call TSIOBufferBlockReadStart(), TSIOBufferReadAvail() should just be equal to th

Re: inconsistent read IOBuffer results

2012-01-02 Thread Brian Geffon
I dont think this is a bug, your usage of TSIOBufferBlockReadStart() is incorrect. The third parameter which you call nbytes is set to the number of bytes remaining in the buffer block after the read. Since you're setting it to zero before the call to TSIOBufferBlockReadStart() it's actually not go

Re: inconsistent read IOBuffer results

2012-01-02 Thread James Peach
On 02/01/2012, at 1:18 PM, James Peach wrote: > 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 gu

Re: inconsistent read IOBuffer results

2012-01-02 Thread James Peach
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()

RE: inconsistent read IOBuffer results

2012-01-02 Thread Brian Geffon
I think you might want TSIOBufferBlockReadAvail and not TSIOBufferReaderAvail. 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 m