diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/logging/SegmentHeaderParser.java b/agent/src/main/java/com/walmartlabs/concord/agent/logging/SegmentHeaderParser.java index d1c3262714..fa801511a6 100644 --- a/agent/src/main/java/com/walmartlabs/concord/agent/logging/SegmentHeaderParser.java +++ b/agent/src/main/java/com/walmartlabs/concord/agent/logging/SegmentHeaderParser.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -79,6 +79,7 @@ public static int parse(byte[] ab, List segments, List invali // reset fieldData.setLength(0); field = Field.MSG_LENGTH; + state = State.FIND_HEADER; break; } @@ -89,8 +90,9 @@ public static int parse(byte[] ab, List segments, List invali String fieldValue = fieldData.toString(); if (fieldData.length() == 0) { // reset - fieldData.setLength(0); field = Field.MSG_LENGTH; + state = State.FIND_HEADER; + bb.position(bb.position() - 1); break; }