Skip to content

Commit cfdf8bd

Browse files
committed
rename
1 parent 71342a8 commit cfdf8bd

5 files changed

Lines changed: 33 additions & 33 deletions

File tree

include/aws/http/http2_stream_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ struct aws_http2_stream_manager_options {
160160
size_t max_connections;
161161
/**
162162
* Optional.
163-
* The max total number of streams that can be active across all connections at the same time.
163+
* The max number of concurrent streams that can be active across all connections at the same time.
164164
* 0 means no limit (default). When this limit is reached, the stream manager will wait for
165165
* existing streams to complete before creating new ones, even if connections have available capacity.
166166
*/
167-
size_t max_total_streams;
167+
size_t max_concurrent_streams;
168168
};
169169

170170
struct aws_http2_stream_manager_acquire_stream_options {

include/aws/http/private/http2_stream_manager_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ struct aws_http2_stream_manager {
116116

117117
/**
118118
* Optional. 0 means no limit (default).
119-
* The max total number of streams that can be active across all connections at the same time.
119+
* The max number of concurrent streams that can be active across all connections at the same time.
120120
* When this limit is reached, the stream manager will wait for existing streams to complete
121121
* before creating new ones, even if connections have available capacity.
122122
*/
123-
size_t max_total_streams;
123+
size_t max_concurrent_streams;
124124

125125
/**
126126
* Task to invoke pending acquisition callbacks asynchronously if stream manager is shutting.

source/http2_stream_manager.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,20 @@ static void s_sm_try_assign_connection_to_pending_stream_acquisition_synced(
152152

153153
AWS_ASSERT(pending_stream_acquisition->sm_connection == NULL);
154154

155-
/* Check if we've reached the max_total_streams limit */
156-
if (stream_manager->max_total_streams > 0) {
155+
/* Check if we've reached the max_concurrent_streams limit */
156+
if (stream_manager->max_concurrent_streams > 0) {
157157
size_t total_active_streams =
158158
stream_manager->synced_data.internal_refcount_stats[AWS_SMCT_OPEN_STREAM] +
159159
stream_manager->synced_data.internal_refcount_stats[AWS_SMCT_PENDING_MAKE_REQUESTS];
160-
if (total_active_streams >= stream_manager->max_total_streams) {
160+
if (total_active_streams >= stream_manager->max_concurrent_streams) {
161161
/* We've reached the limit, cannot assign a connection yet */
162162
STREAM_MANAGER_LOGF(
163163
DEBUG,
164164
stream_manager,
165-
"acquisition:%p waiting - max_total_streams limit reached (%" PRIu64 "/%" PRIu64 ")",
165+
"acquisition:%p waiting - max_concurrent_streams limit reached (%" PRIu64 "/%" PRIu64 ")",
166166
(void *)pending_stream_acquisition,
167167
(uint64_t)total_active_streams,
168-
(uint64_t)stream_manager->max_total_streams);
168+
(uint64_t)stream_manager->max_concurrent_streams);
169169
return;
170170
}
171171
}
@@ -1175,7 +1175,7 @@ struct aws_http2_stream_manager *aws_http2_stream_manager_new(
11751175
stream_manager->max_concurrent_streams_per_connection =
11761176
options->max_concurrent_streams_per_connection ? options->max_concurrent_streams_per_connection : UINT32_MAX;
11771177
stream_manager->max_connections = options->max_connections;
1178-
stream_manager->max_total_streams = options->max_total_streams; /* 0 means no limit */
1178+
stream_manager->max_concurrent_streams = options->max_concurrent_streams; /* 0 means no limit */
11791179
stream_manager->close_connection_on_server_error = options->close_connection_on_server_error;
11801180

11811181
return stream_manager;

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,9 @@ add_net_test_case(h2_sm_mock_goaway)
694694
add_net_test_case(h2_sm_connection_ping)
695695
add_net_test_case(h2_sm_with_flow_control_err)
696696
add_net_test_case(h2_sm_with_initial_settings)
697-
add_net_test_case(h2_sm_mock_max_total_streams)
698-
add_net_test_case(h2_sm_mock_max_total_streams_multiple_connections)
699-
add_net_test_case(h2_sm_mock_max_total_streams_zero_means_no_limit)
697+
add_net_test_case(h2_sm_mock_max_concurrent_streams)
698+
add_net_test_case(h2_sm_mock_max_concurrent_streams_multiple_connections)
699+
add_net_test_case(h2_sm_mock_max_concurrent_streams_zero_means_no_limit)
700700

701701
# Tests against real world server
702702
add_net_test_case(h2_sm_acquire_stream)

tests/test_stream_manager.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,19 +1293,19 @@ TEST_CASE(h2_sm_with_initial_settings) {
12931293
return s_tester_clean_up();
12941294
}
12951295

1296-
/* Test that max_total_streams limits the total number of active streams */
1297-
TEST_CASE(h2_sm_mock_max_total_streams) {
1296+
/* Test that max_concurrent_streams limits the total number of active streams */
1297+
TEST_CASE(h2_sm_mock_max_concurrent_streams) {
12981298
(void)ctx;
1299-
size_t max_total_streams = 5;
1299+
size_t max_concurrent_streams = 5;
13001300
struct sm_tester_options options = {
13011301
.max_connections = 3,
13021302
.max_concurrent_streams_per_connection = 10,
13031303
.alloc = allocator,
13041304
};
13051305
ASSERT_SUCCESS(s_tester_init(&options));
13061306

1307-
/* Set max_total_streams on the stream manager */
1308-
s_tester.stream_manager->max_total_streams = max_total_streams;
1307+
/* Set max_concurrent_streams on the stream manager */
1308+
s_tester.stream_manager->max_concurrent_streams = max_concurrent_streams;
13091309

13101310
s_override_cm_connect_function(s_aws_http_connection_manager_create_connection_sync_mock);
13111311

@@ -1317,9 +1317,9 @@ TEST_CASE(h2_sm_mock_max_total_streams) {
13171317
ASSERT_SUCCESS(s_wait_on_fake_connection_count(1));
13181318
s_drain_all_fake_connection_testing_channel();
13191319

1320-
/* Should have acquired only max_total_streams streams */
1321-
ASSERT_SUCCESS(s_wait_on_streams_acquired_count(max_total_streams));
1322-
ASSERT_UINT_EQUALS(max_total_streams, aws_array_list_length(&s_tester.streams));
1320+
/* Should have acquired only max_concurrent_streams streams */
1321+
ASSERT_SUCCESS(s_wait_on_streams_acquired_count(max_concurrent_streams));
1322+
ASSERT_UINT_EQUALS(max_concurrent_streams, aws_array_list_length(&s_tester.streams));
13231323

13241324
/* Complete 3 streams */
13251325
struct sm_fake_connection *fake_connection = s_get_fake_connection(0);
@@ -1344,19 +1344,19 @@ TEST_CASE(h2_sm_mock_max_total_streams) {
13441344
return s_tester_clean_up();
13451345
}
13461346

1347-
/* Test that max_total_streams works with multiple connections */
1348-
TEST_CASE(h2_sm_mock_max_total_streams_multiple_connections) {
1347+
/* Test that max_concurrent_streams works with multiple connections */
1348+
TEST_CASE(h2_sm_mock_max_concurrent_streams_multiple_connections) {
13491349
(void)ctx;
1350-
size_t max_total_streams = 8;
1350+
size_t max_concurrent_streams = 8;
13511351
struct sm_tester_options options = {
13521352
.max_connections = 4,
13531353
.max_concurrent_streams_per_connection = 3,
13541354
.alloc = allocator,
13551355
};
13561356
ASSERT_SUCCESS(s_tester_init(&options));
13571357

1358-
/* Set max_total_streams */
1359-
s_tester.stream_manager->max_total_streams = max_total_streams;
1358+
/* Set max_concurrent_streams */
1359+
s_tester.stream_manager->max_concurrent_streams = max_concurrent_streams;
13601360

13611361
s_override_cm_connect_function(s_aws_http_connection_manager_create_connection_sync_mock);
13621362

@@ -1368,9 +1368,9 @@ TEST_CASE(h2_sm_mock_max_total_streams_multiple_connections) {
13681368
ASSERT_SUCCESS(s_wait_on_fake_connection_count(4));
13691369
s_drain_all_fake_connection_testing_channel();
13701370

1371-
/* Should have acquired only max_total_streams streams */
1372-
ASSERT_SUCCESS(s_wait_on_streams_acquired_count(max_total_streams));
1373-
ASSERT_UINT_EQUALS(max_total_streams, aws_array_list_length(&s_tester.streams));
1371+
/* Should have acquired only max_concurrent_streams streams */
1372+
ASSERT_SUCCESS(s_wait_on_streams_acquired_count(max_concurrent_streams));
1373+
ASSERT_UINT_EQUALS(max_concurrent_streams, aws_array_list_length(&s_tester.streams));
13741374
/* 4 connections total */
13751375
ASSERT_UINT_EQUALS(4, aws_array_list_length(&s_tester.fake_connections));
13761376

@@ -1398,8 +1398,8 @@ TEST_CASE(h2_sm_mock_max_total_streams_multiple_connections) {
13981398
return s_tester_clean_up();
13991399
}
14001400

1401-
/* Test that max_total_streams = 0 means no limit (default behavior) */
1402-
TEST_CASE(h2_sm_mock_max_total_streams_zero_means_no_limit) {
1401+
/* Test that max_concurrent_streams = 0 means no limit (default behavior) */
1402+
TEST_CASE(h2_sm_mock_max_concurrent_streams_zero_means_no_limit) {
14031403
(void)ctx;
14041404
struct sm_tester_options options = {
14051405
.max_connections = 2,
@@ -1408,8 +1408,8 @@ TEST_CASE(h2_sm_mock_max_total_streams_zero_means_no_limit) {
14081408
};
14091409
ASSERT_SUCCESS(s_tester_init(&options));
14101410

1411-
/* max_total_streams defaults to 0 (no limit) */
1412-
ASSERT_UINT_EQUALS(0, s_tester.stream_manager->max_total_streams);
1411+
/* max_concurrent_streams defaults to 0 (no limit) */
1412+
ASSERT_UINT_EQUALS(0, s_tester.stream_manager->max_concurrent_streams);
14131413

14141414
s_override_cm_connect_function(s_aws_http_connection_manager_create_connection_sync_mock);
14151415

0 commit comments

Comments
 (0)