Use switch-case

This commit is contained in:
Trustin Lee 2013-03-14 18:12:59 +09:00
parent def55f5358
commit 45f937f62b

View File

@ -1215,12 +1215,13 @@ public class SslHandler extends FrameDecoder
synchronized (handshakeLock) { synchronized (handshakeLock) {
result = engine.unwrap(inNetBuf, outAppBuf); result = engine.unwrap(inNetBuf, outAppBuf);
// notify about the CLOSED state of the SSLEngine. See #137 switch (result.getStatus()) {
if (result.getStatus() == Status.CLOSED) { case CLOSED:
sslEngineCloseFuture.setClosed(); // notify about the CLOSED state of the SSLEngine. See #137
} sslEngineCloseFuture.setClosed();
if (result.getStatus() == Status.BUFFER_OVERFLOW) { break;
throw new SSLException("SSLEngine.unwrap() reported an impossible buffer overflow."); case BUFFER_OVERFLOW:
throw new SSLException("SSLEngine.unwrap() reported an impossible buffer overflow.");
} }
final HandshakeStatus handshakeStatus = result.getHandshakeStatus(); final HandshakeStatus handshakeStatus = result.getHandshakeStatus();