Skip to content

Commit

Permalink
out_calyptia: style fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Aug 31, 2023
1 parent dc6d67c commit 76befe9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/out_calyptia/calyptia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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");
}
Expand Down

0 comments on commit 76befe9

Please sign in to comment.