Merge pull request #648 from alex-berger/ssl_handler
Fix race in SslHandler
This commit is contained in:
commit
92a68f59be
@ -300,9 +300,10 @@ public class SslHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
SSLException e = new SSLException("handshake timed out");
|
SSLException e = new SSLException("handshake timed out");
|
||||||
future.setFailure(e);
|
if ( future.setFailure(e) ){
|
||||||
ctx.fireExceptionCaught(e);
|
ctx.fireExceptionCaught(e);
|
||||||
ctx.close();
|
ctx.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, handshakeTimeoutMillis, TimeUnit.MILLISECONDS);
|
}, handshakeTimeoutMillis, TimeUnit.MILLISECONDS);
|
||||||
} else {
|
} else {
|
||||||
@ -320,9 +321,10 @@ public class SslHandler
|
|||||||
handshakeFutures.add(future);
|
handshakeFutures.add(future);
|
||||||
flush(ctx, ctx.newFuture());
|
flush(ctx, ctx.newFuture());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
future.setFailure(e);
|
if ( future.setFailure(e) ) {
|
||||||
ctx.fireExceptionCaught(e);
|
ctx.fireExceptionCaught(e);
|
||||||
ctx.close();
|
ctx.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user