Call fireUserEventTriggered(...) before we try to modify the pipeline
Motivation: We should call fireUserEventTriggered(...) before we try to modify the pipeline as otherwise we may end up in the situation that the handler was already removed. Modifications: Change ordering of calls Result: Test pass again
This commit is contained in:
parent
520d85da11
commit
37d4b5a2f7
@ -117,6 +117,9 @@ public abstract class ApplicationProtocolNegotiationHandler implements ChannelHa
|
|||||||
@Override
|
@Override
|
||||||
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
||||||
if (evt instanceof SslHandshakeCompletionEvent) {
|
if (evt instanceof SslHandshakeCompletionEvent) {
|
||||||
|
// Let's first fire the event before we try to modify the pipeline.
|
||||||
|
ctx.fireUserEventTriggered(evt);
|
||||||
|
|
||||||
SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt;
|
SslHandshakeCompletionEvent handshakeEvent = (SslHandshakeCompletionEvent) evt;
|
||||||
try {
|
try {
|
||||||
if (handshakeEvent.isSuccess()) {
|
if (handshakeEvent.isSuccess()) {
|
||||||
@ -137,7 +140,6 @@ public abstract class ApplicationProtocolNegotiationHandler implements ChannelHa
|
|||||||
} catch (Throwable cause) {
|
} catch (Throwable cause) {
|
||||||
exceptionCaught(ctx, cause);
|
exceptionCaught(ctx, cause);
|
||||||
} finally {
|
} finally {
|
||||||
ctx.fireUserEventTriggered(evt);
|
|
||||||
// Handshake failures are handled in exceptionCaught(...).
|
// Handshake failures are handled in exceptionCaught(...).
|
||||||
if (handshakeEvent.isSuccess()) {
|
if (handshakeEvent.isSuccess()) {
|
||||||
removeSelfIfPresent(ctx);
|
removeSelfIfPresent(ctx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user