Skip to content

Commit

Permalink
Issue jetty#4217 - SslConnection DecryptedEndpoint flush eternal busy…
Browse files Browse the repository at this point in the history
… loop

+ Flush on BUFFER_OVERFLOW

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Oct 30, 2019
1 parent e137ee3 commit c04997f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,10 @@ public boolean flush(ByteBuffer... appOuts) throws IOException
}
return allConsumed;
}
case BUFFER_UNDERFLOW:
{
throw new IllegalStateException();
}
case BUFFER_OVERFLOW:
{
// It's possible that SSLSession.packetBufferSize has been expanded
Expand All @@ -1033,11 +1037,14 @@ public boolean flush(ByteBuffer... appOuts) throws IOException
releaseEncryptedOutputBuffer();
continue;
}
throw new IllegalStateException("Unexpected wrap result " + wrapResultStatus);
}
case BUFFER_UNDERFLOW:
{
throw new IllegalStateException();
if (BufferUtil.isEmpty(_encryptedOutput))
{
throw new IllegalStateException(
String.format("Unexpected wrap result %s (packetBufferSize %d < getPacketBufferSize() %d)",
wrapResultStatus, packetBufferSize, getPacketBufferSize()
));
}
// fall-through default case to flush()
}
default:
{
Expand Down

0 comments on commit c04997f

Please sign in to comment.