Provisional fix for #681

This commit is contained in:
Greg Wilkins 2016-07-01 15:05:27 +10:00
parent 77b91038db
commit 3a52b46115
1 changed files with 12 additions and 7 deletions

View File

@ -92,6 +92,7 @@ public class SslConnection extends AbstractConnection
private final boolean _encryptedDirectBuffers = true;
private final boolean _decryptedDirectBuffers = false;
private boolean _renegotiationAllowed;
private boolean _closedOutbound;
private final Runnable _runCompletWrite = new Runnable()
{
@Override
@ -913,19 +914,23 @@ public class SslConnection extends AbstractConnection
@Override
public void shutdownOutput()
{
boolean ishut = isInputShutdown();
boolean oshut = isOutputShutdown();
if (LOG.isDebugEnabled())
LOG.debug("{} shutdownOutput: oshut={}, ishut={}", SslConnection.this, oshut, ishut);
try
{
synchronized (this)
{
boolean ishut = isInputShutdown();
boolean oshut = isOutputShutdown();
if (LOG.isDebugEnabled())
LOG.debug("{} shutdownOutput: oshut={}, ishut={}", SslConnection.this, oshut, ishut);
if (!oshut)
{
_sslEngine.closeOutbound();
// Send the TLS close message.
flush(BufferUtil.EMPTY_BUFFER);
if (!_closedOutbound)
{
_closedOutbound=true; // Only attempt this once
_sslEngine.closeOutbound();
flush(BufferUtil.EMPTY_BUFFER); // Send the TLS close message.
}
if (ishut)
getEndPoint().close();
else