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 31f0173bebb..65813b610a5 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 @@ -79,8 +79,6 @@ import org.eclipse.jetty.util.log.Logger; public class SslConnection extends AbstractConnection { private static final Logger LOG = Log.getLogger(SslConnection.class); - private static final ByteBuffer __FILL_CALLED_FLUSH= BufferUtil.allocate(0); - private static final ByteBuffer __FLUSH_CALLED_FILL= BufferUtil.allocate(0); private final List handshakeListeners = new ArrayList<>(); private final ByteBufferPool _bufferPool; @@ -666,11 +664,11 @@ public class SslConnection extends AbstractConnection { // If we are called from flush() // return to let it do the wrapping. - if (buffer == __FLUSH_CALLED_FILL) + if (_flushRequiresFillToProgress) return 0; _fillRequiresFlushToProgress = true; - flush(__FILL_CALLED_FLUSH); + flush(BufferUtil.EMPTY_BUFFER); if (BufferUtil.isEmpty(_encryptedOutput)) { // The flush wrote all the encrypted bytes so continue to fill. @@ -899,11 +897,11 @@ public class SslConnection extends AbstractConnection case NEED_UNWRAP: // Ah we need to fill some data so we can write. // So if we were not called from fill and the app is not reading anyway - if (appOuts[0]!=__FILL_CALLED_FLUSH && !getFillInterest().isInterested()) + if (!_fillRequiresFlushToProgress && !getFillInterest().isInterested()) { // Tell the onFillable method that there might be a write to complete _flushRequiresFillToProgress = true; - fill(__FLUSH_CALLED_FILL); + fill(BufferUtil.EMPTY_BUFFER); // Check if after the fill() we need to wrap again if (_sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_WRAP) continue;