From 93a5ff0b8912e236b74aef041b03a820e5001cb9 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 25 Oct 2019 16:41:26 -0500 Subject: [PATCH] Issue #4217 - SslConnection DecryptedEndpoint flush eternal busy loop + Small cleanup of duplicate if statements Signed-off-by: Joakim Erdfelt --- .../eclipse/jetty/io/ssl/SslConnection.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java index 18e9c46d3ae..88e95e8fef4 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java @@ -692,14 +692,6 @@ public class SslConnection extends AbstractConnection _underFlown = unwrapResultStatus == Status.BUFFER_UNDERFLOW || unwrapResultStatus == Status.OK && unwrapResult.bytesConsumed() == 0 && unwrapResult.bytesProduced() == 0; - if (_underFlown) - { - if (net_filled < 0 && _sslEngine.getUseClientMode()) - closeInbound(); - if (net_filled <= 0) - return net_filled; - } - switch (unwrapResultStatus) { case CLOSED: @@ -707,32 +699,22 @@ public class SslConnection extends AbstractConnection switch (handshakeStatus) { case NOT_HANDSHAKING: - { // We were not handshaking, so just tell the app we are closed return -1; - } case NEED_TASK: - { _sslEngine.getDelegatedTask().run(); continue; - } case NEED_WRAP: - { // We need to send some handshake data (probably the close handshake). // We return -1 so that the application can drive the close by flushing // or shutting down the output. return -1; - } case NEED_UNWRAP: - { // We expected to read more, but we got closed. // Return -1 to indicate to the application to drive the close. return -1; - } default: - { throw new IllegalStateException(); - } } } case BUFFER_OVERFLOW: @@ -762,8 +744,7 @@ public class SslConnection extends AbstractConnection catch (SSLException closeFailure) { Throwable handshakeFailure = new SSLHandshakeException("Abruptly closed by peer"); - if (closeFailure != null) - handshakeFailure.initCause(closeFailure); + handshakeFailure.initCause(closeFailure); throw handshakeFailure; }