NETTY-426 Prevent a user from reusing an upstream MessageEvent to write
something Modified the pipeline implementations so that it rejects the attempt to send an UpstreamMessageEvent to downstream
This commit is contained in:
parent
4bf26c31e9
commit
dfd7b0d6c3
@ -590,6 +590,10 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
void sendDownstream(DefaultChannelHandlerContext ctx, ChannelEvent e) {
|
||||
if (e instanceof UpstreamMessageEvent) {
|
||||
throw new IllegalArgumentException("cannot send an upstream event to downstream");
|
||||
}
|
||||
|
||||
try {
|
||||
((ChannelDownstreamHandler) ctx.getHandler()).handleDownstream(ctx, e);
|
||||
} catch (Throwable t) {
|
||||
|
@ -407,6 +407,10 @@ public class StaticChannelPipeline implements ChannelPipeline {
|
||||
}
|
||||
|
||||
void sendDownstream(StaticChannelHandlerContext ctx, ChannelEvent e) {
|
||||
if (e instanceof UpstreamMessageEvent) {
|
||||
throw new IllegalArgumentException("cannot send an upstream event to downstream");
|
||||
}
|
||||
|
||||
try {
|
||||
((ChannelDownstreamHandler) ctx.getHandler()).handleDownstream(ctx, e);
|
||||
} catch (Throwable t) {
|
||||
|
Loading…
Reference in New Issue
Block a user