Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/fluent-bit/flb_aws_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ struct flb_aws_client {

/* Send all log messages as debug; used in AWS Cred Providers on init */
int debug_only;

/* Callbacks context */
struct flb_callback *http_cb_ctx;
};

/* frees dynamic_headers */
Expand Down
6 changes: 6 additions & 0 deletions plugins/out_kinesis_firehose/firehose.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "firehose.h"
#include "firehose_api.h"

int flb_http_client_debug_setup(struct flb_callback *cb_ctx, struct mk_list *props);

static struct flb_aws_header content_type_header = {
.key = "Content-Type",
.key_len = 12,
Expand Down Expand Up @@ -288,6 +290,10 @@ static int cb_firehose_init(struct flb_output_instance *ins,
ctx->firehose_client->proxy = NULL;
ctx->firehose_client->static_headers = &content_type_header;
ctx->firehose_client->static_headers_len = 1;
if (flb_http_client_debug_setup(ctx->firehose_client->http_cb_ctx, &ins->properties) < 0) {
flb_plg_error(ctx->ins, "AWS HTTP client debug initialization error");
goto error;
}

struct flb_upstream *upstream = flb_upstream_create(config, ctx->endpoint,
ctx->port, FLB_IO_TLS,
Expand Down
9 changes: 9 additions & 0 deletions src/aws/flb_aws_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ struct flb_aws_client *flb_aws_client_create()
client->client_vtable = &client_vtable;
client->retry_requests = FLB_FALSE;
client->debug_only = FLB_FALSE;
client->http_cb_ctx = flb_callback_create("aws client"); // FIXME: what name?
if (!client->http_cb_ctx) {
flb_errno();
flb_callback_destroy(client->http_cb_ctx);
return NULL;
}
return client;
}

Expand All @@ -291,6 +297,7 @@ void flb_aws_client_destroy(struct flb_aws_client *aws_client)
if (aws_client->extra_user_agent) {
flb_sds_destroy(aws_client->extra_user_agent);
}
flb_callback_destroy(aws_client->http_cb_ctx);
flb_free(aws_client);
}
}
Expand Down Expand Up @@ -386,6 +393,8 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client,
goto error;
}

c->cb_ctx = aws_client->http_cb_ctx;

/* Increase the maximum HTTP response buffer size to fit large responses from AWS services */
ret = flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE);
if (ret != 0) {
Expand Down
Loading