Skip to content

Commit f778a48

Browse files
add user data
1 parent 29ceb35 commit f778a48

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

include/aws/s3/s3_buffer_pool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ struct aws_s3_buffer_pool_config {
141141
* by logging failure reason, returning null and raising aws_error.
142142
*/
143143
typedef struct aws_s3_buffer_pool *(aws_s3_buffer_pool_factory_fn)(struct aws_allocator *allocator,
144-
struct aws_s3_buffer_pool_config config);
144+
struct aws_s3_buffer_pool_config config,
145+
void *user_data);
145146

146147
AWS_EXTERN_C_END
147148
AWS_POP_SANE_WARNING_LEVEL

include/aws/s3/s3_client.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,9 @@ struct aws_s3_client_config {
606606
* if not set creates default implementation of the buffer pool.
607607
*/
608608
aws_s3_buffer_pool_factory_fn *buffer_pool_factory_fn;
609+
610+
/* User data thats passed into pool factory. */
611+
void *buffer_pool_user_data;
609612
};
610613

611614
struct aws_s3_checksum_config {

source/s3_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ struct aws_s3_client *aws_s3_client_new(
367367
};
368368

369369
if (client_config->buffer_pool_factory_fn) {
370-
client->buffer_pool = client_config->buffer_pool_factory_fn(allocator, buffer_pool_config);
370+
client->buffer_pool = client_config->buffer_pool_factory_fn(allocator, buffer_pool_config,
371+
client_config->buffer_pool_user_data);
371372
} else {
372373

373374
client->buffer_pool = aws_s3_default_buffer_pool_new(allocator, buffer_pool_config);

0 commit comments

Comments
 (0)