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: leonchen83 <chen.bao.yi@qq.com>
  • Loading branch information
leonchen83 committed Oct 28, 2020
1 parent 723eb15 commit 10051a6
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -209,13 +209,9 @@ protected void decompress(ByteAccumulator accumulator, ByteBuffer buf) throws Da
{
byte[] output = accumulator.newByteArray(DECOMPRESS_BUF_SIZE);
read = inflater.inflate(output);
if (read < 0)
if (read <= 0)
{
break;
}
else if (read == 0)
{
if (LOG.isDebugEnabled())
if (read == 0 && LOG.isDebugEnabled())
LOG.debug("Decompress: read 0 {}", toDetail(inflater));
break;
}
Expand Down

0 comments on commit 10051a6

Please sign in to comment.