Merge branch 'master' into 3.0.0

pull/1303/head
Nikita 7 years ago
commit d4ec646ffc

@ -147,16 +147,20 @@ public class CommandDecoder extends ReplayingDecoder<State> {
}
if (state().getLevels().size() == 1) {
StateLevel firstLevel = state().getLevels().get(0);
if (firstLevel.getParts().isEmpty()) {
if (firstLevel.getParts().isEmpty() && firstLevel.getLastList() == null) {
state().resetLevel();
decode(in, cmd, null, ctx.channel());
} else {
if (firstLevel.getLastList() != null) {
if (firstLevel.getLastList().isEmpty()) {
decode(in, cmd, firstLevel.getParts(), ctx.channel());
} else {
decodeList(in, cmd, firstLevel.getParts(), ctx.channel(), firstLevel.getLastListSize(), firstLevel.getLastList());
}
firstLevel.setLastList(null);
firstLevel.setLastListSize(0);
if (in.isReadable()) {
while (in.isReadable() && firstLevel.getParts().size() < firstLevel.getSize()) {
decode(in, cmd, firstLevel.getParts(), ctx.channel());
}
decodeList(in, cmd, null, ctx.channel(), 0, firstLevel.getParts());

@ -111,6 +111,10 @@ public class ListMultiDecoder<T> implements MultiDecoder<Object> {
}
int index = getDecoder(state).getIndex();
if (index == -1) {
getDecoder(state).resetIndex();
index = 0;
}
Decoder<Object> decoder = decoders[index].getDecoder(paramNum, state);
if (decoder == RESET) {
NestedDecoderState s = getDecoder(state);

Loading…
Cancel
Save