Skip to content

Commit

Permalink
Add seperate err msg for Unpack issue
Browse files Browse the repository at this point in the history
Signed-off-by: Athish Pranav D <[email protected]>
  • Loading branch information
Athishpranav2003 committed Sep 12, 2024
1 parent e7b5c29 commit 3756d96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/fluent-bit/flb_msgpack_append_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define FLB_MAP_NOT_MODIFIED -1
#define FLB_MAP_EXPANSION_ERROR -2
#define FLB_MAP_EXPANSION_INVALID_VALUE_TYPE -3
#define FLB_MSGPACK_UNPACK_ERROR -4

#include <fluent-bit/flb_pack.h>
#include <msgpack/unpack.h>
Expand Down
2 changes: 1 addition & 1 deletion plugins/filter_parser/filter_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int cb_parser_filter(const void *data, size_t bytes,
out_buf = strdup(parsed_buf);
out_size = parsed_size;
}
if (ctx->hash_value_field!=NULL) {
if (ctx->hash_value_field != NULL) {
char *new_buf = NULL;
size_t new_size;
int ret;
Expand Down
4 changes: 2 additions & 2 deletions src/flb_msgpack_append_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ int flb_msgpack_append_map_to_record(char **result_buffer,
if ((i=msgpack_unpack_next(&unpacker, map_data, map_size, &off)) !=
MSGPACK_UNPACK_SUCCESS ) {
msgpack_unpacked_destroy(&unpacker);
return FLB_MAP_EXPANSION_ERROR;
return FLB_MSGPACK_UNPACK_ERROR;
}
if (unpacker.data.type != MSGPACK_OBJECT_MAP) {
msgpack_unpacked_destroy(&unpacker);
return FLB_MAP_EXPANSION_ERROR;
return FLB_MSGPACK_UNPACK_ERROR;
}

message_entry.val = unpacker.data;
Expand Down

0 comments on commit 3756d96

Please sign in to comment.