From 76befe9fd0bb85f688051b2d506081e845deda51 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Thu, 31 Aug 2023 11:22:53 -0400 Subject: [PATCH] out_calyptia: style fixes. Signed-off-by: Phillip Whelan --- plugins/out_calyptia/calyptia.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/out_calyptia/calyptia.c b/plugins/out_calyptia/calyptia.c index 96c6838f3ba..463f74fdec0 100644 --- a/plugins/out_calyptia/calyptia.c +++ b/plugins/out_calyptia/calyptia.c @@ -939,17 +939,18 @@ static void cb_calyptia_flush(struct flb_event_chunk *event_chunk, } #ifdef FLB_HAVE_CHUNK_TRACE - // in_emitter no longer allows us to sent the event type so use the tag instead. if (strcmp(event_chunk->tag, "trace") == 0) { json = flb_pack_msgpack_to_json_format(event_chunk->data, event_chunk->size, FLB_PACK_JSON_FORMAT_STREAM, FLB_PACK_JSON_DATE_DOUBLE, NULL); + if (json == NULL) { flb_upstream_conn_release(u_conn); FLB_OUTPUT_RETURN(FLB_RETRY); } + out_buf = (char *)json; out_size = flb_sds_len(json); @@ -959,8 +960,10 @@ static void cb_calyptia_flush(struct flb_event_chunk *event_chunk, flb_sds_destroy(json); FLB_OUTPUT_RETURN(FLB_RETRY); } + c = flb_http_client(u_conn, FLB_HTTP_POST, ctx->trace_endpoint, out_buf, out_size, NULL, 0, NULL, 0); + if (!c) { flb_upstream_conn_release(u_conn); flb_sds_destroy(json); @@ -970,6 +973,7 @@ static void cb_calyptia_flush(struct flb_event_chunk *event_chunk, /* perform request: 'ret' might be FLB_OK, FLB_ERROR or FLB_RETRY */ ret = calyptia_http_do(ctx, c, CALYPTIA_ACTION_TRACE); + if (ret == FLB_OK) { flb_plg_debug(ctx->ins, "trace delivered OK"); }