Synchronized between 4.1 and master
Motivation: 4 and 5 were diverged long time ago and we recently reverted some of the early commits in master. We must make sure 4.1 and master are not very different now. Modification: Small adjustments to match up branches Result: 4.1 and master got closer.
This commit is contained in:
parent
db3709e652
commit
a2f1f21612
@ -537,7 +537,7 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
}
|
||||
|
||||
private void callHandlerAdded(final ChannelHandlerContext ctx) {
|
||||
private void callHandlerAdded(final DefaultChannelHandlerContext ctx) {
|
||||
if (ctx.channel().isRegistered() && !ctx.executor().inEventLoop()) {
|
||||
ctx.executor().execute(new Runnable() {
|
||||
@Override
|
||||
@ -550,13 +550,13 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
callHandlerAdded0(ctx);
|
||||
}
|
||||
|
||||
private void callHandlerAdded0(final ChannelHandlerContext ctx) {
|
||||
private void callHandlerAdded0(final DefaultChannelHandlerContext ctx) {
|
||||
try {
|
||||
ctx.handler().handlerAdded(ctx);
|
||||
} catch (Throwable t) {
|
||||
boolean removed = false;
|
||||
try {
|
||||
remove((DefaultChannelHandlerContext) ctx);
|
||||
remove(ctx);
|
||||
removed = true;
|
||||
} catch (Throwable t2) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
@ -934,7 +934,7 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelFuture deregister(final ChannelPromise promise) {
|
||||
public ChannelFuture deregister(ChannelPromise promise) {
|
||||
return tail.deregister(promise);
|
||||
}
|
||||
|
||||
@ -1046,7 +1046,7 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { }
|
||||
}
|
||||
|
||||
static final class HeadHandler implements ChannelOutboundHandler {
|
||||
static final class HeadHandler extends ChannelOutboundHandlerAdapter {
|
||||
|
||||
private final Unsafe unsafe;
|
||||
|
||||
@ -1054,16 +1054,6 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
this.unsafe = unsafe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(
|
||||
ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise)
|
||||
@ -1090,7 +1080,6 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
unsafe.deregister(promise);
|
||||
}
|
||||
@ -1109,10 +1098,5 @@ final class DefaultChannelPipeline implements ChannelPipeline {
|
||||
public void flush(ChannelHandlerContext ctx) throws Exception {
|
||||
unsafe.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
ctx.fireExceptionCaught(cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user