Skip to content

Commit

Permalink
Fix #6082 Reduce SSL buffer compaction
Browse files Browse the repository at this point in the history
Only continue if compact creates more space

Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Mar 23, 2021
1 parent 09f39d7 commit 485e561
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -711,12 +711,9 @@ public int fill(ByteBuffer buffer) throws IOException
return filled = -1;

case BUFFER_UNDERFLOW:
// Can we compact?
if (_encryptedInput.position() != 0)
{
BufferUtil.compact(_encryptedInput);
// Continue if we can compact?
if (BufferUtil.compact(_encryptedInput))
continue;
}

// Are we out of space?
if (BufferUtil.space(_encryptedInput) == 0)
Expand Down

0 comments on commit 485e561

Please sign in to comment.