[#710] flush() requests made before SSL handshake completion are not executed after completion

- Ensure SslHandler flushes its outbound buffer on handshake completion
- Enable SSL in HttpSnoopClient example
This commit is contained in:
Trustin Lee 2012-11-05 16:37:40 +09:00
parent d293e6c389
commit 86b777a919
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import io.netty.handler.codec.http.HttpClientCodec;
import io.netty.handler.codec.http.HttpContentDecompressor; import io.netty.handler.codec.http.HttpContentDecompressor;
import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler; import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.ssl.SslHandler;
import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLEngine;
@ -46,8 +47,7 @@ public class HttpSnoopClientInitializer extends ChannelInitializer<SocketChannel
SecureChatSslContextFactory.getClientContext().createSSLEngine(); SecureChatSslContextFactory.getClientContext().createSSLEngine();
engine.setUseClientMode(true); engine.setUseClientMode(true);
// FIXME: Port SslHandler to the new API p.addLast("ssl", new SslHandler(engine));
//p.addLast("ssl", new SslHandler(engine));
} }
p.addLast("codec", new HttpClientCodec()); p.addLast("codec", new HttpClientCodec());

View File

@ -802,6 +802,7 @@ public class SslHandler
break; break;
case FINISHED: case FINISHED:
setHandshakeSuccess(); setHandshakeSuccess();
wrapLater = true;
continue; continue;
case NOT_HANDSHAKING: case NOT_HANDSHAKING:
break; break;