From 9a365b101e961414696e2a0a169b755773a499f0 Mon Sep 17 00:00:00 2001 From: Alwayswithme Date: Tue, 21 Apr 2015 14:03:27 +0800 Subject: [PATCH] fix the discardedBytes counting on LineBasedFrameDecoder Motivation: The LineBasedFrameDecoder discardedBytes counting different compare to DelimiterBasedFrameDecoder. Modifications: Add plus sign Result: DiscardedBytes counting correctly --- .../main/java/io/netty/handler/codec/LineBasedFrameDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java b/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java index ab49530de5..aee97d3c50 100644 --- a/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java @@ -130,7 +130,7 @@ public class LineBasedFrameDecoder extends ByteToMessageDecoder { fail(ctx, length); } } else { - discardedBytes = buffer.readableBytes(); + discardedBytes += buffer.readableBytes(); buffer.readerIndex(buffer.writerIndex()); } return null;