Hi Ben,
seems that the patch https://github.com/apache/mina/pull/28 calls the buff.free() method which does nothing in most of the cases:
SimpleBuffer: @Override publicvoidfree() { // Do nothing } IoBufferImpl: publicvoidfree() { } The on ly implementation that actually frees the buffer is CachedBuffer. I'll create a JIRA and try to write a test case for this issue. Thanks for the report! Le 12/02/2025 à 09:25, Ben Avraham, Eyal a écrit :
Bug Summary In Apache MINA 2.1.10, CumulativeProtocolDecoder does not properly handle cumulative buffer states when processing fragmented messages. Under certain conditions, date received on the stream are processed more than once. The problem: In version 2.1.10 the code changed so that when the BUFFER remaining is zero, the BUFFER is NOT removed from session, The next time doDecode() is called the in buffer contains in addition to the new just arrived data some data from that already processed. Buffer before doDecode return has remaining=0, pos=x, lim=x... When new data received, let say with y bytes the in buffer in doDecode() has remaining=x+y, pos=0, lim=x+y... Thanks, Eyal & Tom