Skip to content

Commit 3863eea

Browse files
committed
Enable HTTP debugging for AWS client requests
Signed-off-by: Ryan Underwood <ryan.underwood@mongodb.com>
1 parent 286466f commit 3863eea

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/fluent-bit/flb_aws_util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ struct flb_aws_client {
102102

103103
/* Send all log messages as debug; used in AWS Cred Providers on init */
104104
int debug_only;
105+
106+
/* Callbacks context */
107+
struct flb_callback *callback;
105108
};
106109

107110
/* frees dynamic_headers */

src/aws/flb_aws_util.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ struct flb_aws_client *flb_aws_client_create()
268268
client->client_vtable = &client_vtable;
269269
client->retry_requests = FLB_FALSE;
270270
client->debug_only = FLB_FALSE;
271+
client->callback = flb_callback_create("aws client"); // FIXME: what name?
272+
if (!client->callback) {
273+
flb_errno();
274+
return NULL;
275+
}
271276
return client;
272277
}
273278

@@ -291,6 +296,7 @@ void flb_aws_client_destroy(struct flb_aws_client *aws_client)
291296
if (aws_client->extra_user_agent) {
292297
flb_sds_destroy(aws_client->extra_user_agent);
293298
}
299+
flb_free(aws_client->callback);
294300
flb_free(aws_client);
295301
}
296302
}
@@ -386,6 +392,8 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client,
386392
goto error;
387393
}
388394

395+
c->cb_ctx = aws_client->callback;
396+
389397
/* Increase the maximum HTTP response buffer size to fit large responses from AWS services */
390398
ret = flb_http_buffer_size(c, FLB_MAX_AWS_RESP_BUFFER_SIZE);
391399
if (ret != 0) {

0 commit comments

Comments
 (0)