(replying to the mailing list)

On 20/03/2019 15:11, Jonathan Valliere wrote:
And mina is calling reset() bad combo.  Why would mina ever need to modify the position?  Just keep on writing the buffer as-is until flushed?

It should. Any filter taking a IoBuffer as an input should *never* modify it. It could replace it, but not reset/flip/whatever.

I suspect there is some attempt to avoid creating a new buffer at some point, for performance reasons. We shoudl review all the filters to check that they are not doing such a thing...


On Wed, Mar 20, 2019 at 10:01 AM Emmanuel Lécharny <[email protected] <mailto:[email protected]>> wrote:


    On 20/03/2019 14:02, Jonathan Valliere wrote:
    > Nothing in Mina should use the mark/reset functionality because
    it does not
    > compound and the unknown addition of filters create edge cases
    where it is
    > compounded.  Should manually grab he position and manually
    revert the
    > position when necessary.


    The zlib class is flipping the buffer, that may be the cause of
    this issue.

         public IoBuffer deflate(IoBuffer inBuffer) throws IOException {
             if (mode == MODE_INFLATER) {
                 throw new IllegalStateException("not initialized as
    DEFLATER");
             }

             byte[] inBytes = new byte[inBuffer.remaining()];
             inBuffer.get(inBytes).flip();

Reply via email to