Skip to content

Commit

Permalink
Fixing bug with num_active_vip_connections counter (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
rccarper authored Mar 2, 2021
1 parent f2110f5 commit c03a30e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,8 +1364,19 @@ static void s_s3_client_assign_requests_to_connections_threaded(
(!client_active || (vip_connection->http_connection == NULL ||
!aws_http_connection_is_open(vip_connection->http_connection) ||
vip_connection->request_count >= s_s3_max_request_count_per_connection))) {

if (vip_connection->is_active) {
int sub_result = aws_sub_u32_checked(
client->threaded_data.num_active_vip_connections,
1,
&client->threaded_data.num_active_vip_connections);
AWS_ASSERT(sub_result == AWS_OP_SUCCESS);
(void)sub_result;

vip_connection->is_active = false;
}

aws_s3_vip_connection_destroy(client, vip_connection);
--client->threaded_data.num_active_vip_connections;
continue;
}

Expand Down

0 comments on commit c03a30e

Please sign in to comment.