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