Fix SslHandler handshake timeout cancellation bug

This commit is contained in:
Jeff Pinner 2013-03-24 14:58:28 -07:00 committed by Norman Maurer
parent f136fb3673
commit 4e60c395a9

View File

@ -314,13 +314,19 @@ public class SslHandler
timeoutFuture = null;
}
promise.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture f) throws Exception {
if (timeoutFuture != null) {
timeoutFuture.cancel(false);
}
}
});
ctx.executor().execute(new Runnable() {
@Override
public void run() {
try {
if (timeoutFuture != null) {
timeoutFuture.cancel(false);
}
engine.beginHandshake();
handshakePromises.add(promise);
flush0(ctx, ctx.newPromise(), true);