Ensure that either SslHandler's handshake timeout or the handshake
itself (or its failure) take place but not both.
This commit is contained in:
parent
129c19c33e
commit
ce88ae3889
@ -300,10 +300,11 @@ public class SslHandler
|
||||
}
|
||||
|
||||
SSLException e = new SSLException("handshake timed out");
|
||||
future.setFailure(e);
|
||||
if ( future.setFailure(e) ){
|
||||
ctx.fireExceptionCaught(e);
|
||||
ctx.close();
|
||||
}
|
||||
}
|
||||
}, handshakeTimeoutMillis, TimeUnit.MILLISECONDS);
|
||||
} else {
|
||||
timeoutFuture = null;
|
||||
@ -320,11 +321,12 @@ public class SslHandler
|
||||
handshakeFutures.add(future);
|
||||
flush(ctx, ctx.newFuture());
|
||||
} catch (Exception e) {
|
||||
future.setFailure(e);
|
||||
if ( future.setFailure(e) ) {
|
||||
ctx.fireExceptionCaught(e);
|
||||
ctx.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return future;
|
||||
|
Loading…
Reference in New Issue
Block a user