diff --git a/source/s3_client.c b/source/s3_client.c index e259a75fa..7e5e78ade 100644 --- a/source/s3_client.c +++ b/source/s3_client.c @@ -213,9 +213,17 @@ struct aws_s3_client *aws_s3_client_new( aws_ref_count_init(&client->ref_count, client, (aws_simple_completion_callback *)s_s3_client_start_destroy); + aws_mutex_init(&client->synced_data.lock); + + aws_linked_list_init(&client->synced_data.vips); + aws_linked_list_init(&client->synced_data.pending_vip_connection_updates); + aws_linked_list_init(&client->synced_data.pending_meta_request_work); + + aws_linked_list_init(&client->threaded_data.idle_vip_connections); + aws_linked_list_init(&client->threaded_data.meta_requests); + /* Store our client bootstrap. */ - client->client_bootstrap = client_config->client_bootstrap; - aws_client_bootstrap_acquire(client_config->client_bootstrap); + client->client_bootstrap = aws_client_bootstrap_acquire(client_config->client_bootstrap); struct aws_event_loop_group *event_loop_group = client_config->client_bootstrap->event_loop_group; aws_event_loop_group_acquire(event_loop_group); @@ -309,15 +317,6 @@ struct aws_s3_client *aws_s3_client_new( client->cached_signing_config = aws_cached_signing_config_new(client->allocator, client_config->signing_config); } - aws_mutex_init(&client->synced_data.lock); - - aws_linked_list_init(&client->synced_data.vips); - aws_linked_list_init(&client->synced_data.pending_vip_connection_updates); - aws_linked_list_init(&client->synced_data.pending_meta_request_work); - - aws_linked_list_init(&client->threaded_data.idle_vip_connections); - aws_linked_list_init(&client->threaded_data.meta_requests); - client->synced_data.active = true; if (client_config->retry_strategy != NULL) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8bce7bc6e..da4e25aad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB TEST_SRC "*.c") file(GLOB TEST_HDRS "*.h") file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC}) -add_test_case(test_s3_client_create_destroy) +add_net_test_case(test_s3_client_create_destroy) add_test_case(test_s3_request_create_destroy) add_net_test_case(test_s3_client_exceed_retries) @@ -16,8 +16,8 @@ add_net_test_case(test_s3_meta_request_sign_request_fail) add_net_test_case(test_s3_meta_request_send_request_finish_fail) add_net_test_case(test_s3_auto_range_put_missing_upload_id) -add_test_case(test_s3_vip_create_destroy) -add_test_case(test_s3_client_add_remove_vips) +add_net_test_case(test_s3_vip_create_destroy) +add_net_test_case(test_s3_client_add_remove_vips) add_net_test_case(test_s3_client_resolve_vips) add_net_test_case(test_s3_get_object_tls_disabled)