Skip to content

Commit

Permalink
Revert "Use SimpleChannelInboundHandler to filter on ByteBuf"
Browse files Browse the repository at this point in the history
This reverts commit 20ab5e7be0c02f1b15f3bdc16499bddba6c4d8af.
  • Loading branch information
RagnarW authored and martinfurmanski committed Sep 10, 2018
1 parent 111f38e commit dab2dd3
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -24,13 +24,13 @@

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.ReferenceCountUtil;

import org.neo4j.causalclustering.catchup.Protocol;
import org.neo4j.causalclustering.messaging.marshalling.v2.ContentType;

public class ContentTypeDispatcher extends SimpleChannelInboundHandler<ByteBuf>
public class ContentTypeDispatcher extends ChannelInboundHandlerAdapter
{
private final Protocol<ContentType> contentTypeProtocol;

Expand All @@ -40,14 +40,14 @@ public ContentTypeDispatcher( Protocol<ContentType> contentTypeProtocol )
}

@Override
protected void channelRead0( ChannelHandlerContext ctx, ByteBuf msg )
public void channelRead( ChannelHandlerContext ctx, Object msg )
{
if ( contentTypeProtocol.isExpecting( ContentType.ContentType ) )
{
byte messageCode = msg.readByte();
byte messageCode = ((ByteBuf) msg).readByte();
ContentType contentType = getContentType( messageCode );
contentTypeProtocol.expect( contentType );
if ( msg.readableBytes() == 0 )
if ( ((ByteBuf) msg).readableBytes() == 0 )
{
ReferenceCountUtil.release( msg );
return;
Expand Down

0 comments on commit dab2dd3

Please sign in to comment.