Merge pull request #6486 from eclipse/jetty-9.4.x-6470-MessageInputStreamEOF

Issue #6470 - prevent EOF being released back into pool in MessageInputStream
This commit is contained in:
Lachlan 2021-06-30 19:24:44 +10:00 committed by GitHub
commit 40535f1cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -163,7 +163,8 @@ public class MessageInputStream extends InputStream implements MessageAppender
for (ByteBuffer buffer : buffers)
{
bufferPool.release(buffer);
if (buffer != null && buffer != EOF)
bufferPool.release(buffer);
}
activeBuffer = null;
@ -259,7 +260,8 @@ public class MessageInputStream extends InputStream implements MessageAppender
synchronized (this)
{
// Release buffer back to pool.
bufferPool.release(activeBuffer);
if (activeBuffer != null && activeBuffer != EOF)
bufferPool.release(activeBuffer);
activeBuffer = null;
switch (state)