Skip to content

Commit

Permalink
flb_aws_util: set max response buffer size for the http client
Browse files Browse the repository at this point in the history
Signed-off-by: Rayhan Hossain <[email protected]>
  • Loading branch information
hossain-rayhan authored and PettitWesley committed Sep 3, 2021
1 parent d296e98 commit 8734df8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/aws/flb_aws_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define S3_KEY_SIZE 1024
#define RANDOM_STRING "$UUID"
#define INDEX_STRING "$INDEX"
#define FLB_MAX_AWS_RESP_BUFFER_SIZE 0 /* 0 means unlimited capacity as per requirement */

struct flb_http_client *request_do(struct flb_aws_client *aws_client,
int method, const char *uri,
Expand Down Expand Up @@ -309,6 +310,12 @@ struct flb_http_client *request_do(struct flb_aws_client *aws_client,
goto error;
}

/* 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) {
flb_warn("[aws_http_client] failed to increase max response buffer size");
}

/* Add AWS Fluent Bit user agent */
if (aws_client->extra_user_agent == NULL) {
ret = flb_http_add_header(c, "User-Agent", 10,
Expand Down

0 comments on commit 8734df8

Please sign in to comment.