Skip to content

Commit 35a4ca5

Browse files
authored
Merge branch 'main' into byte-buf-fix
2 parents 50bc073 + 17f67d9 commit 35a4ca5

18 files changed

Lines changed: 343 additions & 85 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
203203
204204
macos:
205-
runs-on: macos-14 #latest
205+
runs-on: macos-15 #latest
206206
steps:
207207
- uses: aws-actions/configure-aws-credentials@v4
208208
with:
@@ -220,7 +220,7 @@ jobs:
220220
python3 codebuild/macos_compatibility_check.py
221221
222222
macos-x64:
223-
runs-on: macos-14-large #latest
223+
runs-on: macos-15-large #latest
224224
steps:
225225
- uses: aws-actions/configure-aws-credentials@v4
226226
with:
@@ -287,7 +287,7 @@ jobs:
287287
288288
289289
localhost-test-macos:
290-
runs-on: macos-14 # latest
290+
runs-on: macos-15 # latest
291291
steps:
292292
- uses: aws-actions/configure-aws-credentials@v4
293293
with:

crt/aws-c-auth

crt/aws-lc

src/main/java/software/amazon/awssdk/crt/http/Http2StreamManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ private Http2StreamManager(Http2StreamManagerOptions options) {
123123
maxConnections,
124124
idealConcurrentStreamsPerConnection,
125125
maxConcurrentStreamsPerConnection,
126+
options.getMaxConcurrentStreams(),
126127
options.hasPriorKnowledge(),
127128
options.shouldCloseConnectionOnServerError(),
128129
options.getConnectionPingPeriodMs(),
@@ -265,6 +266,7 @@ private static native long http2StreamManagerNew(Http2StreamManager thisObj,
265266
int maxConns,
266267
int ideal_concurrent_streams_per_connection,
267268
int max_concurrent_streams_per_connection,
269+
int max_concurrent_streams,
268270
boolean priorKnowledge,
269271
boolean closeConnectionOnServerError,
270272
int connectionPingPeriodMs,

src/main/java/software/amazon/awssdk/crt/http/Http2StreamManagerOptions.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
* instance
1010
*/
1111
public class Http2StreamManagerOptions {
12-
public static final int DEFAULT_MAX_WINDOW_SIZE = Integer.MAX_VALUE;
1312
public static final int DEFAULT_MAX = Integer.MAX_VALUE;
14-
public static final int DEFAULT_MAX_CONNECTIONS = 2;
1513
public static final int DEFAULT_CONNECTION_PING_TIMEOUT_MS = 3000;
1614
private static final String HTTPS = "https";
1715

@@ -20,6 +18,7 @@ public class Http2StreamManagerOptions {
2018
private int idealConcurrentStreamsPerConnection = 100;
2119
private boolean connectionManualWindowManagement = false;
2220
private int maxConcurrentStreamsPerConnection = DEFAULT_MAX;
21+
private int maxConcurrentStreams = 0;
2322

2423
private boolean priorKnowledge = false;
2524
private boolean closeConnectionOnServerError = false;
@@ -108,6 +107,28 @@ public int getMaxConcurrentStreamsPerConnection() {
108107
return maxConcurrentStreamsPerConnection;
109108
}
110109

110+
/**
111+
* The max number of concurrent streams that can be active across all connections
112+
* at the same time. 0 means no limit (default). When this limit is reached, the
113+
* stream manager will wait for existing streams to complete before creating new
114+
* ones, even if connections have available capacity.
115+
*
116+
* @param maxConcurrentStreams The max number of concurrent streams across all connections
117+
* @return this
118+
*/
119+
public Http2StreamManagerOptions withMaxConcurrentStreams(int maxConcurrentStreams) {
120+
this.maxConcurrentStreams = maxConcurrentStreams;
121+
return this;
122+
}
123+
124+
/**
125+
* @return The max number of concurrent streams across all connections.
126+
* 0 means no limit (default).
127+
*/
128+
public int getMaxConcurrentStreams() {
129+
return maxConcurrentStreams;
130+
}
131+
111132
/**
112133
* @return The connection level manual flow control enabled or not.
113134
*/

0 commit comments

Comments
 (0)