Skip to content

Commit 01f3911

Browse files
tests: handle TRUNCATED return case
Addresses PR comments and adds correspoinding unit tests Signed-off-by: Mirko Lazarevic <[email protected]>
1 parent 128f9e4 commit 01f3911

File tree

2 files changed

+219
-63
lines changed

2 files changed

+219
-63
lines changed

src/multiline/flb_ml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int package_content(struct flb_ml_stream *mst,
269269
truncated = FLB_TRUE;
270270
}
271271

272-
if (stream_group->mp_sbuf.size == 0) {
272+
if (!truncated && stream_group->mp_sbuf.size == 0) {
273273
flb_ml_register_context(stream_group, tm, full_map);
274274
}
275275

@@ -346,7 +346,7 @@ static int package_content(struct flb_ml_stream *mst,
346346
processed = FLB_TRUE;
347347
}
348348

349-
if (processed && metadata != NULL) {
349+
if (!truncated && processed && metadata != NULL) {
350350
msgpack_pack_object(&stream_group->mp_md_pck, *metadata);
351351
}
352352

0 commit comments

Comments
 (0)