Skip to content

Commit

Permalink
netty#7285 Improved "Discarded inbound message" warning for embedded …
Browse files Browse the repository at this point in the history
…channel (netty#9414)

Motivation:

Look like `EmbeddedChannelPipeline` should also override `onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg)` in order to do not print "Discarded message pipeline" because in case of `EmbeddedChannelPipeline` discarding actually not happens.

This fixes next warning in the latest netty version with websocket and `WebSocketServerCompressionHandler`:

```
13:36:36.231 DEBUG- Decoding WebSocket Frame opCode=2
13:36:36.231 DEBUG- Decoding WebSocket Frame length=5
13:36:36.231 DEBUG- Discarded message pipeline : [JdkZlibDecoder#0, DefaultChannelPipeline$TailContext#0]. Channel : [id: 0xembedded, L:embedded - R:embedded].
```

Modification:

Override correct method

Result:
Follow up fix after netty#9286
  • Loading branch information
doom369 authored and normanmaurer committed Aug 3, 2019
1 parent 1194577 commit 005fd55
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelId;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelMetadata;
Expand Down Expand Up @@ -873,8 +874,8 @@ protected void onUnhandledInboundException(Throwable cause) {
}

@Override
protected void onUnhandledInboundMessage(Object msg) {
handleInboundMessage(msg);
protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) {
handleInboundMessage(msg);
}
}
}

0 comments on commit 005fd55

Please sign in to comment.