Merged branch 'jetty-9.4.x-2836-ssl_cannot_reuse_connection' into 'jetty-9.4.x'.
This commit is contained in:
commit
c5aa15bdd4
|
@ -93,15 +93,19 @@ public abstract class FillInterest
|
|||
/**
|
||||
* Call to signal that a read is now possible.
|
||||
*/
|
||||
public void fillable()
|
||||
public boolean fillable()
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("fillable {}",this);
|
||||
Callback callback = _interested.get();
|
||||
if (callback != null && _interested.compareAndSet(callback, null))
|
||||
{
|
||||
callback.succeeded();
|
||||
else if (LOG.isDebugEnabled())
|
||||
return true;
|
||||
}
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("{} lost race {}",this,callback);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -399,27 +399,27 @@ public class SslConnection extends AbstractConnection
|
|||
try
|
||||
{
|
||||
// If we are handshaking, then wake up any waiting write as well as it may have been blocked on the read
|
||||
boolean waiting_for_fill = false;
|
||||
boolean waiting_for_fill;
|
||||
synchronized(_decryptedEndPoint)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onFillable {}", SslConnection.this);
|
||||
|
||||
_fillState = FillState.IDLE;
|
||||
switch(_flushState)
|
||||
{
|
||||
case WAIT_FOR_FILL:
|
||||
waiting_for_fill = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
waiting_for_fill = _flushState==FlushState.WAIT_FOR_FILL;
|
||||
}
|
||||
|
||||
// Ensure a fill is always done if needed then wake up any fill interest
|
||||
if (waiting_for_fill)
|
||||
fill(BufferUtil.EMPTY_BUFFER);
|
||||
|
||||
getFillInterest().fillable();
|
||||
|
||||
if (waiting_for_fill)
|
||||
{
|
||||
synchronized(_decryptedEndPoint)
|
||||
{
|
||||
waiting_for_fill = _flushState==FlushState.WAIT_FOR_FILL;
|
||||
}
|
||||
if (waiting_for_fill)
|
||||
fill(BufferUtil.EMPTY_BUFFER);
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
|
@ -1246,11 +1246,11 @@ public class SslConnection extends AbstractConnection
|
|||
if (fillable)
|
||||
_fillState = FillState.IDLE;
|
||||
}
|
||||
|
||||
_decryptedEndPoint.getWriteFlusher().completeWrite();
|
||||
|
||||
if (fillable)
|
||||
_decryptedEndPoint.getFillInterest().fillable();
|
||||
|
||||
_decryptedEndPoint.getWriteFlusher().completeWrite();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue