Catch+fire Exceptions thrown from SniHandler's select() method

Motivation

Give the user the ability to back out from SNI negoations.

Modifications

Put a try-catch around the select() call and re-fire any caught Exceptions.

Result

Fixes #5787
This commit is contained in:
Roger Kapsi 2016-09-16 12:26:12 -04:00 committed by Norman Maurer
parent 8d6f0a3ce4
commit 9a18159bfe

View File

@ -244,8 +244,12 @@ public class SniHandler extends ByteToMessageDecoder implements ChannelOutboundH
final String hostname = in.toString(offset, serverNameLength,
CharsetUtil.UTF_8);
select(ctx, IDN.toASCII(hostname,
IDN.ALLOW_UNASSIGNED).toLowerCase(Locale.US));
try {
select(ctx, IDN.toASCII(hostname,
IDN.ALLOW_UNASSIGNED).toLowerCase(Locale.US));
} catch (Throwable t) {
ctx.fireExceptionCaught(t);
}
return;
} else {
// invalid enum value