Skip to content

Commit

Permalink
Fix SslHandler handshake timeout cancellation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Pinner authored and Norman Maurer committed Mar 25, 2013
1 parent f136fb3 commit 4e60c39
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions handler/src/main/java/io/netty/handler/ssl/SslHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,19 @@ public void run() {
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);
Expand Down

0 comments on commit 4e60c39

Please sign in to comment.