Skip to content

Commit cb8c067

Browse files
Merge pull request ReactiveX#5 from g9yuayon/remoting-local
Added immediate checkpoint to avoid unnecessary re-scan of buffer upon b...
2 parents 50c3703 + aa82278 commit cb8c067

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rxjava-contrib/rxjava-netty/src/main/java/rx/netty/experimental/protocol/StringLineCodec.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
5858
switch(state()) {
5959
case NEW_LINE:
6060
String line = readFullLine(in);
61+
62+
// Immediately checkpoint the progress so that replaying decoder
63+
// will not start over from the beginning of the line when buffer overflows
64+
checkpoint();
65+
6166
out.add(line);
6267
break;
6368
case END_OF_LINE:

0 commit comments

Comments
 (0)