Skip to content

Commit

Permalink
agent: fix log segments parse (#586)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3ddf624)
  • Loading branch information
brig authored and mtkunkel committed Mar 11, 2022
1 parent 32fda11 commit ebeb6da
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -79,6 +79,7 @@ public static int parse(byte[] ab, List<Segment> segments, List<Position> invali
// reset
fieldData.setLength(0);
field = Field.MSG_LENGTH;
state = State.FIND_HEADER;
break;
}

Expand All @@ -89,8 +90,9 @@ public static int parse(byte[] ab, List<Segment> segments, List<Position> 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;
}

Expand Down

0 comments on commit ebeb6da

Please sign in to comment.