Fixes #4444 - Connection timeout intermittently when using jetty 9.4.25.
Fixed handling of encrypted bytes to write in needsFillInterest() when the TLS handshake status is NOT_HANDSHAKING. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
ccf04a47cd
commit
5794584aea
|
@ -862,6 +862,11 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
{
|
||||
interest = true;
|
||||
_fillState = FillState.INTERESTED;
|
||||
if (_flushState == FlushState.IDLE && BufferUtil.hasContent(_encryptedOutput))
|
||||
{
|
||||
_flushState = FlushState.WRITING;
|
||||
write = _encryptedOutput;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1489,19 +1494,23 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
public void succeeded()
|
||||
{
|
||||
boolean fillable;
|
||||
boolean interested;
|
||||
synchronized (_decryptedEndPoint)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("IncompleteWriteCB succeeded {}", SslConnection.this);
|
||||
|
||||
releaseEncryptedOutputBuffer();
|
||||
_flushState = FlushState.IDLE;
|
||||
|
||||
interested = _fillState == FillState.INTERESTED;
|
||||
fillable = _fillState == FillState.WAIT_FOR_FLUSH;
|
||||
if (fillable)
|
||||
_fillState = FillState.IDLE;
|
||||
}
|
||||
|
||||
if (fillable)
|
||||
if (interested)
|
||||
ensureFillInterested();
|
||||
else if (fillable)
|
||||
_decryptedEndPoint.getFillInterest().fillable();
|
||||
|
||||
_decryptedEndPoint.getWriteFlusher().completeWrite();
|
||||
|
@ -1520,7 +1529,8 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
releaseEncryptedOutputBuffer();
|
||||
|
||||
_flushState = FlushState.IDLE;
|
||||
failFillInterest = _fillState == FillState.WAIT_FOR_FLUSH;
|
||||
failFillInterest = _fillState == FillState.WAIT_FOR_FLUSH ||
|
||||
_fillState == FillState.INTERESTED;
|
||||
if (failFillInterest)
|
||||
_fillState = FillState.IDLE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue