On 04/12/2014 13:17, Rémy Maucherat wrote:
> 2014-12-04 14:11 GMT+01:00 Mark Thomas <ma...@apache.org>:
> 
>> The used flag is only ever set to true. It needs to be reset to false
>> after a write to avoid multiple flush() calls one after the other
>> triggering empty writes.
>>
>> Looking at the code, what would be better is if something along the
>> lines of using buffer.flip(), buffer.remaining().
>>
>> I'm looking at the code now so I'll put a test case and a patch together.
>>
> I made one further commit on this, but it is lost in limbo at the moment.

Ah. I see that now. My code reviews for the WebSocket changes have
fallen too far behind. I'm working on catching up.

> I would recommend not touching anything for now.

I might still write the test case. Nothing is going to happen until svn
returns to read/write anyway.

> The purpose of the flag is so that close always writes a last part unless
> nothing was ever written.

Shouldn't there still be a single empty message in that case? Otherwise,
how is the client meant to differentiate between no write and a write of
zero length?

> I did add a if (buffer.position > 0) in flush to
> avoid useless empty writes.

I see that now.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to