Skip to content

Commit

Permalink
Fix issue jetty#5499
Browse files Browse the repository at this point in the history
this PR let the ByteAccumulator recyclable. after invoke ByteAccumulator.transferTo method
we can invoke ByteAccumulator.recycle method to reuse byte[] via ByteAccumulator.newByteArray method

Signed-off-by: Baoyi Chen <chen.bao.yi@qq.com>
  • Loading branch information
leonchen83 committed Oct 30, 2020
1 parent 7bfd1dc commit dd0c63c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -179,7 +179,7 @@ protected ByteAccumulator newByteAccumulator()
int maxSize = Math.max(getPolicy().getMaxTextMessageSize(), getPolicy().getMaxBinaryMessageSize());
if (accumulator == null || accumulator.getMaxSize() != maxSize)
{
accumulator = new ByteAccumulator(maxSize);
accumulator = new ByteAccumulator(maxSize, getBufferPool());
}
return accumulator;
}
Expand Down

0 comments on commit dd0c63c

Please sign in to comment.