Skip to content

Commit

Permalink
Merge pull request #6486 from eclipse/jetty-9.4.x-6470-MessageInputSt…
Browse files Browse the repository at this point in the history
…reamEOF

Issue #6470 - prevent EOF being released back into pool in MessageInputStream
  • Loading branch information
lachlan-roberts committed Jun 30, 2021
2 parents f045b5a + 039a539 commit 40535f1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ public void close()

for (ByteBuffer buffer : buffers)
{
bufferPool.release(buffer);
if (buffer != null && buffer != EOF)
bufferPool.release(buffer);
}

activeBuffer = null;
Expand Down Expand Up @@ -259,7 +260,8 @@ public int read(byte[] b, int off, int len) throws IOException
synchronized (this)
{
// Release buffer back to pool.
bufferPool.release(activeBuffer);
if (activeBuffer != null && activeBuffer != EOF)
bufferPool.release(activeBuffer);
activeBuffer = null;

switch (state)
Expand Down

0 comments on commit 40535f1

Please sign in to comment.