Skip to content

Commit

Permalink
Fixes #6072 - jetty server high CPU when client send data length > 17…
Browse files Browse the repository at this point in the history
…408.

Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Mar 22, 2021
1 parent 00d379c commit 294b2ba
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -729,13 +729,15 @@ public int fill(ByteBuffer buffer) throws IOException
return filled = -1;

case BUFFER_UNDERFLOW:
if (netFilled > 0)
if (BufferUtil.space(_encryptedInput) == 0)
{
if (BufferUtil.space(_encryptedInput) > 0)
continue; // try filling some more
BufferUtil.clear(_encryptedInput);
throw new SSLHandshakeException("Encrypted buffer max length exceeded");
}

if (netFilled > 0)
continue; // try filling some more

_underflown = true;
if (netFilled < 0 && _sslEngine.getUseClientMode())
{
Expand Down

0 comments on commit 294b2ba

Please sign in to comment.