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
bf41f4b099
commit
fba8c7b7a4
|
@ -564,6 +564,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) {
|
||||
|
|
|
@ -381,6 +381,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