Thanks for the tips. My local flush was actually based on
org.xnio.conduits.BufferedStreamSinkConduit including a terminated flag,
except that i was also passing terminateWrites() on to the delegate. I'll
try it with writeFinal() instead.
On 03/11/2014 9:11 PM, "Stuart Douglas" <sdouglas(a)redhat.com> wrote:
org.xnio.conduits.BufferedStreamSinkConduit is probably a good
although it does not use writeFinal().
----- Original Message -----
> From: "Stuart Douglas" <sdouglas(a)redhat.com>
> To: "Jeff Williams" <jeffw(a)wherethebitsroam.com>
> Cc: undertow-dev(a)lists.jboss.org
> Sent: Tuesday, 4 November, 2014 7:10:53 AM
> Subject: Re: [undertow-dev] AbstractFixedLengthStreamSinkConduit
> You need to not pass on the terminateWrites() call to the delegate until
> have written all your data.
> Once terminateWrites is called on your channel set some kind of boolean
> to indicate that this is shutdown, and then when the user calls flush()
> write out the buffer (using writeFinal for best performance). If you are
> using writeFinal() then you need to call terminateWrites() once you
> in flushing, and then pass further flush calls to the delegate.
> ----- Original Message -----
> > From: "Jeff Williams" <jeffw(a)wherethebitsroam.com>
> > To: undertow-dev(a)lists.jboss.org
> > Sent: Monday, 3 November, 2014 11:48:10 PM
> > Subject: [undertow-dev] AbstractFixedLengthStreamSinkConduit
> > Hi,
> > I have written a StreamSinkConduit which buffers content in a pooled
> > buffer.
> > I am having an issue with AbstractFixedLengthStreamSinkConduit
> > FixedLengthUnderflowException exception.
> > If I have content left in my buffer which I have not yet been able to
> > to the next conduit when terminateWrites is called, the exception is
> > thrown.
> > Even though this content would have been written in the subsequent
> > flush. Shouldn't the bytes remaining be checked after a successful
> > rather than in terminateWrites? Or am I missing something?
> > For the time being I am flushing my local buffer in terminateWrites,
> > this
> > seems wrong!
> > Jeff
> > _______________________________________________
> > undertow-dev mailing list
> > undertow-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/undertow-dev