Code cleanups.

This commit is contained in:
Simone Bordet 2016-05-24 10:27:18 +02:00
parent b1ebcf9139
commit f95daca8b4
3 changed files with 50 additions and 46 deletions

View File

@ -404,8 +404,9 @@ abstract public class WriteFlusher
}
}
/* ------------------------------------------------------------ */
/** Flush the buffers iteratively until no progress is made
/**
* Flushes the buffers iteratively until no progress is made.
*
* @param buffers The buffers to flush
* @return The unflushed buffers, or null if all flushed
* @throws IOException if unable to flush

View File

@ -576,7 +576,7 @@ public class SslConnection extends AbstractConnection
{
_handshaken = true;
if (LOG.isDebugEnabled())
LOG.debug("{} {} handshook {}/{}", SslConnection.this,
LOG.debug("{} {} handshake succeeded {}/{}", SslConnection.this,
_sslEngine.getUseClientMode() ? "client" : "resumed server",
_sslEngine.getSession().getProtocol(),_sslEngine.getSession().getCipherSuite());
}
@ -758,6 +758,7 @@ public class SslConnection extends AbstractConnection
switch (wrapResultStatus)
{
case CLOSED:
{
// The SSL engine has close, but there may be close handshake that needs to be written
if (BufferUtil.hasContent(_encryptedOutput))
{
@ -777,11 +778,13 @@ public class SslConnection extends AbstractConnection
getEndPoint().shutdownOutput();
}
return allConsumed;
}
case BUFFER_UNDERFLOW:
{
throw new IllegalStateException();
}
default:
{
if (LOG.isDebugEnabled())
LOG.debug("{} wrap {} {}", SslConnection.this, wrapResultStatus, BufferUtil.toHexSummary(_encryptedOutput));
@ -789,7 +792,7 @@ public class SslConnection extends AbstractConnection
{
_handshaken = true;
if (LOG.isDebugEnabled())
LOG.debug("{} server handshook complete {}/{}", SslConnection.this, _sslEngine.getSession().getProtocol(),_sslEngine.getSession().getCipherSuite());
LOG.debug("{} server handshake succeeded {}/{}", SslConnection.this, _sslEngine.getSession().getProtocol(),_sslEngine.getSession().getCipherSuite());
}
HandshakeStatus handshakeStatus = _sslEngine.getHandshakeStatus();
@ -847,6 +850,7 @@ public class SslConnection extends AbstractConnection
case FINISHED:
throw new IllegalStateException();
}
}
}
}
}

View File

@ -154,7 +154,6 @@ public class SslConnectionFactoryTest
Assert.assertThat(socket.getInputStream().read(),Matchers.equalTo(-1));
}
}
private String getResponse(String sniHost,String reqHost, String cn) throws Exception