Skip to content

Commit 85aa8f9

Browse files
committed
in_opentelemetry: handle exception on unsupported compress format
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
1 parent a6b8d85 commit 85aa8f9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

plugins/in_opentelemetry/opentelemetry_prot.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int uncompress_zlib(struct flb_opentelemetry *ctx,
173173
size_t input_size)
174174
{
175175
flb_plg_warn(ctx->ins, "zlib decompression is not supported");
176-
return 0;
176+
return -1;
177177
}
178178

179179
static \
@@ -206,7 +206,7 @@ int uncompress_deflate(struct flb_opentelemetry *ctx,
206206
size_t input_size)
207207
{
208208
flb_plg_warn(ctx->ins, "deflate decompression is not supported");
209-
return 0;
209+
return -1;
210210
}
211211

212212
static \
@@ -552,7 +552,16 @@ int opentelemetry_prot_handle(struct flb_opentelemetry *ctx, struct http_conn *c
552552
&uncompressed_data,
553553
&uncompressed_data_size);
554554

555-
if (ret > 0) {
555+
if (ret < 0) {
556+
flb_sds_destroy(tag);
557+
mk_mem_free(uri);
558+
if (out_chunked != NULL) {
559+
mk_mem_free(out_chunked);
560+
}
561+
send_response(conn, 400, "error: decompression error\n");
562+
return -1;
563+
}
564+
else if (ret > 0) {
556565
request->data.data = uncompressed_data;
557566
request->data.len = uncompressed_data_size;
558567
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy