Merge pull request #648 from alex-berger/ssl_handler

Fix race in SslHandler
This commit is contained in:
Norman Maurer 2012-10-10 06:08:30 -07:00
commit 92a68f59be

View File

@ -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;