Skip to content

Commit a9f4bd1

Browse files
authored
Merge branch 'master' into dependabot/maven/log4j.version-2.25.2
2 parents ed24134 + f0f60ab commit a9f4bd1

50 files changed

Lines changed: 3328 additions & 82 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@v4
63+
uses: actions/checkout@v5
6464

6565
# Initializes the CodeQL tools for scanning.
6666
- name: Initialize CodeQL

.github/workflows/depsreview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: 'Checkout Repository'
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030
- name: 'Dependency Review'
3131
uses: actions/dependency-review-action@v4

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ jobs:
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v5
4040
- uses: actions/cache@v4
4141
with:
4242
path: ~/.m2/repository
4343
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4444
restore-keys: |
4545
${{ runner.os }}-maven-
4646
- name: Set up JDK ${{ matrix.java }}
47-
uses: actions/setup-java@v4
47+
uses: actions/setup-java@v5
4848
with:
4949
distribution: 'temurin'
5050
java-version: ${{ matrix.java }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ Protocol conformance
4040
-
4141
- [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110) - HTTP Semantics
4242
- [RFC 9112](https://datatracker.ietf.org/doc/html/rfc9112) - Hypertext Transfer Protocol Version 1.1 (HTTP/1.1)
43-
- [RFC 7540](https://datatracker.ietf.org/doc/html/rfc7540) - Hypertext Transfer Protocol Version 2 (HTTP/2)
43+
- [RFC 9113](https://datatracker.ietf.org/doc/html/rfc9113) - Hypertext Transfer Protocol Version 2 (HTTP/2)
4444
- [RFC 7541](https://datatracker.ietf.org/doc/html/rfc7541) - HPACK: Header Compression for HTTP/2
4545
- [RFC 1945](https://datatracker.ietf.org/doc/html/rfc1945) - Hypertext Transfer Protocol -- HTTP/1.0
4646
- [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) - Uniform Resource Identifier (URI): Generic Syntax
47+
- [RFC 9218](https://datatracker.ietf.org/doc/html/rfc9218) - Extensible Prioritization Scheme for HTTP
4748

4849
Licensing
4950
---------

RELEASE_NOTES.txt

Lines changed: 191 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,209 @@
11
Release 5.4-alpha1
22
------------------
33

4-
This is the first release in the 5.4 release series.
5-
4+
This is the first ALPHA release in the 5.4 release series that improves HTTP/2 protocol
5+
support by ensuring conformance to the latest HTTP specification (RFC 9113) and adds
6+
support for Unix domain sockets.
7+
8+
This release also includes all the fixes from the stable 5.3 branch.
9+
10+
Notable changes and features included in the 5.4 series:
11+
12+
* Experimental OFFLOCK (lock-free) connection pool.
13+
14+
* Conformance to RFC 9218 (Extensible Prioritization Scheme for HTTP).
15+
16+
* Improved conformance to RFC 9113 (Hypertext Transfer Protocol Version 2).
17+
18+
* Five-second TCP keep-alive enabled by default.
19+
20+
* Unix domain socket support by the classic and async transports.
21+
22+
* Redesign of classic over async API bridge.
23+
24+
* Improved URI encoding per RFC 3986.
25+
26+
* QUERY method support.
27+
28+
629

730
Change Log
831
-------------------
932

10-
* Add ContentType.APPLICATION_ZIP_COMPRESSED.
11-
Contributed by Gary Gregory <ggregory at apache.org>
33+
* Experimental RouteSegmentedConnPool (OFFLOCK): lock-free, route-segmented, disposal off
34+
critical path.
35+
Contributed by Arturo Bernal <abernal at apache.org>
1236

13-
* Bump io.reactivex.rxjava3:rxjava from 3.1.9 to 3.1.10 #509
14-
Contributed by Gary Gregory <ggregory at apache.org>
37+
* Configurable AuthorityResolver for async server bootstraps.
38+
Contributed by Christian de Waal <christian at de.waal.name>
1539

16-
* Bump org.junit:junit-bom from 5.11.0 to 5.13.3 #501, #528, #533
17-
Contributed by Gary Gregory <ggregory at apache.org>
40+
* RFC 9218 HTTP/2 Priority support (#552).
41+
Contributed by Arturo Bernal <abernal at apache.org>
1842

19-
* Bump testcontainers.version from 1.20.2 to 1.20.4 #505
20-
Contributed by Gary Gregory <ggregory at apache.org>
43+
* Stale connection check for the async protocol handlers.
44+
Contributed by Ryan Schmitt <rschmitt at apache.org>
45+
46+
* Corrected JavaDoc for HttpConnection#close to reference correct CloseMode mode (#561).
47+
Contributed by Arturo Bernal <abernal at apache.org>
48+
49+
* HTTPCORE-785: Improved Javadocs of TlsStrategy implementations.
50+
Contributed by Oleg Kalnichevski <olegk at apache.org>
51+
52+
* HTTPCORE-785: Updated request execution example with Conscrypt as a security provider.
53+
Contributed by Oleg Kalnichevski <olegk at apache.org>
54+
55+
* Five-second TCP keep-alive enabled by default.
56+
Contributed by Ryan Schmitt <rschmitt at apache.org>
57+
58+
* RFC 9113 conformance: H2 stream can be cancelled (reset) locally from multiple threads.
59+
Contributed by Oleg Kalnichevski <olegk at apache.org>
60+
61+
* RFC 9113 conformance: Strict SETTINGS_MAX_CONCURRENT_STREAMS enforcement for inbound and
62+
outbound streams.
63+
Contributed by Oleg Kalnichevski <olegk at apache.org>
64+
65+
* RFC 9113 conformance: Use command queue to activate streams reserved with a push promise.
66+
Contributed by Oleg Kalnichevski <olegk at apache.org>
67+
68+
* RFC 9113 conformance: Improved H2 stream creation and initialization, improved H2 stream
69+
state tracking and tracking of total stream counts.
70+
Contributed by Oleg Kalnichevski <olegk at apache.org>
71+
72+
* RFC 9113 conformance: Corrected H2 stream ID generation and verification logic.
73+
Contributed by Oleg Kalnichevski <olegk at apache.org>
74+
75+
* RFC 9113 conformance: Refactoring of internal H2 stream APIs.
76+
Contributed by Oleg Kalnichevski <olegk at apache.org>
77+
78+
* RFC 9113 conformance: Merge multiple Cookie Header fields into a single field after
79+
decompression.
80+
Contributed by Oleg Kalnichevski <olegk at apache.org>
81+
82+
* RFC 9113 conformance: Stricter validation of message fields.
83+
Contributed by Oleg Kalnichevski <olegk at apache.org>
84+
85+
* RFC 9113 conformance: RST_STREAM with NO_ERROR error code gracefully terminates the request
86+
on the client if the server has sent the complete response (the stream has been closed
87+
remotely).
88+
Contributed by Oleg Kalnichevski <olegk at apache.org>
89+
90+
* Revised graceful / immediate H2 connection shutdown.
91+
Contributed by Oleg Kalnichevski <olegk at apache.org>
92+
93+
* RFC 9113 conformance: Ensure the ID of promised streams is valid (greater than the last seen).
94+
Contributed by Oleg Kalnichevski <olegk at apache.org>
95+
96+
* RFC 9113 conformance: Treat ENABLE_PUSH set to 1 transmitted by the server endpoint as
97+
a protocol error.
98+
Contributed by Oleg Kalnichevski <olegk at apache.org>
99+
100+
* RFC 9113 conformance: Treat attempts to send frames on a locally closed stream as a protocol
101+
violation.
102+
Contributed by Oleg Kalnichevski <olegk at apache.org>
103+
104+
* HTTP/1.1 async protocol handler to read message data more greedily.
105+
Contributed by Oleg Kalnichevski <olegk at apache.org>
106+
107+
* Optimized release of resources associated with H2 streams. #releaseResources should be called
108+
only once.
109+
Contributed by Oleg Kalnichevski <olegk at apache.org>
110+
111+
* H2 transport to enforce a max limit on the number of CONTINUATION frames.
112+
Contributed by Oleg Kalnichevski <olegk at apache.org>
113+
114+
* Socket keep-alive option support.
115+
Contributed by Ryan Schmitt <rschmitt at apache.org>
116+
117+
* Discontinue use of SocketSupport to set extended socket options.
118+
Contributed by Ryan Schmitt <rschmitt at apache.org>
119+
120+
* IOFunction functional interface.
121+
Contributed by Arturo Bernal <abernal at apache.org>
122+
123+
* Safeguard for infinite unproductive loop in non-blocking SSL session #527.
124+
Contributed by Ali Farahani <ali.farahani at genesys.com>
125+
126+
* Slightly better and efficient #toHexString method.
127+
Contributed by Oleg Kalnichevski <olegk at apache.org>
21128

22-
* Bump testcontainers.version from 1.21.1 to 1.21.3 #530, #534
129+
* HTTP/2 protocol handler to allow configuring FrameFractory (#525).
130+
Contributed by Marko <marco at sitar.dev>
131+
132+
* ContentType.APPLICATION_ZIP_COMPRESSED (#524).
23133
Contributed by Gary Gregory <ggregory at apache.org>
24134

25-
* Bump log4j.version from 2.24.3 to 2.25.0 #529
135+
* I/O reactors to support Unix domain sockets.
136+
Contributed by Ryan Schmitt <rschmitt at apache.org>
137+
138+
* Redesign of classic over async bridge.
139+
Contributed by Oleg Kalnichevski <olegk at apache.org>
140+
141+
* Shared buffers to support timeout on blocking operations.
142+
Contributed by Oleg Kalnichevski <olegk at apache.org>
143+
144+
* Added a method to the async response channel to terminate the ongoing message exchange
145+
due to an internal error.
146+
Contributed by Oleg Kalnichevski <olegk at apache.org>
147+
148+
* Avoid legacy Socket API in reactor code.
149+
Contributed by Ryan Schmitt <rschmitt at apache.org>
150+
151+
* Support for parsing of headers representing a list of complex elements.
152+
Contributed by Oleg Kalnichevski <olegk at apache.org>
153+
154+
* RFC 3986 conformant URI encoding policy (#517).
155+
Contributed by Arturo Bernal <abernal at apache.org>
156+
157+
* Protocol negotiation handlers to use exception callback to report unexpected exceptions
158+
during the protocol negotiation handshake.
159+
Contributed by Oleg Kalnichevski <olegk at apache.org>
160+
161+
* Updated error message in ProtocolVersion.
162+
Contributed by Mavelous <github at mavelo.us>
163+
164+
* Handle overflow in Deadline calculation to ensure correct behavior for large time values
165+
(#512).
166+
Contributed by Arturo Bernal <abernal at apache.org>
167+
168+
* HTTPCORE-774: Update window management improvements.
169+
Contributed by Oleg Kalnichevski <olegk at apache.org>
170+
171+
* Added more convenience methods to classic request / response builders.
172+
Contributed by Oleg Kalnichevski <olegk at apache.org>
173+
174+
* HTTPCORE-773: Introduced customizable strategy to select I/O dispatch worker for new I/O
175+
channels.
176+
Contributed by Oleg Kalnichevski <olegk at apache.org>
177+
178+
* Optimize connection close logic to resolve timeout delay issue (#508).
179+
Contributed by Noah <yuns994@gmail.com>
180+
181+
* NoConnectionReuseStrategy
182+
Contributed by Johnny Lim <izeye@naver.com>
183+
184+
* Polish Javadoc for HttpResponseInterceptor.
185+
Contributed by Johnny Lim <izeye@naver.com>
186+
187+
* HTTP Method QUERY support (#499).
188+
Contributed by Mario Daniel Ruiz Saavedra <desiderantes93 at gmail.com>
189+
190+
* Ensure Date header is always present and replace invalid values. (#500).
191+
Contributed by Arturo Bernal <abernal at apache.org>
192+
193+
* HTTP/1.1 TE header interceptor and strict client/server option (#498).
194+
Contributed by Arturo Bernal <abernal at apache.org>
195+
196+
* HTTPCLIENT-2233: Metrics listener for IOReactor thread pool monitoring (#490).
197+
Contributed by Arturo Bernal <abernal at apache.org>
198+
199+
* A FutureContribution should not allow a null BasicFuture (#485).
26200
Contributed by Gary Gregory <ggregory at apache.org>
27201

202+
* HTTPCORE-770: Introduced `plusAsBlank` parameter for dynamic configuration.
203+
Contributed by Arturo Bernal <abernal at apache.org>
204+
205+
206+
28207
Release 5.3
29208
------------------
30209

httpcore5-h2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>org.apache.httpcomponents.core5</groupId>
3030
<artifactId>httpcore5-parent</artifactId>
31-
<version>5.4-alpha1-SNAPSHOT</version>
31+
<version>5.4-alpha2-SNAPSHOT</version>
3232
</parent>
3333
<artifactId>httpcore5-h2</artifactId>
3434
<name>Apache HttpComponents Core HTTP/2</name>

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/config/H2Param.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public enum H2Param {
3838
MAX_CONCURRENT_STREAMS(0x3),
3939
INITIAL_WINDOW_SIZE(0x4),
4040
MAX_FRAME_SIZE(0x5),
41-
MAX_HEADER_LIST_SIZE(0x6);
41+
MAX_HEADER_LIST_SIZE(0x6),
42+
SETTINGS_NO_RFC7540_PRIORITIES (0x9);
4243

4344
int code;
4445

@@ -50,25 +51,32 @@ public int getCode() {
5051
return code;
5152
}
5253

53-
private static final H2Param[] LOOKUP_TABLE = new H2Param[6];
54+
private static final H2Param[] LOOKUP_TABLE;
5455
static {
55-
for (final H2Param param: H2Param.values()) {
56-
LOOKUP_TABLE[param.code - 1] = param;
56+
int max = 0;
57+
for (final H2Param p : H2Param.values()) {
58+
if (p.code > max) {
59+
max = p.code;
60+
}
61+
}
62+
LOOKUP_TABLE = new H2Param[max + 1];
63+
for (final H2Param p : H2Param.values()) {
64+
LOOKUP_TABLE[p.code] = p;
5765
}
5866
}
5967

6068
public static H2Param valueOf(final int code) {
61-
if (code < 1 || code > LOOKUP_TABLE.length) {
69+
if (code < 0 || code >= LOOKUP_TABLE.length) {
6270
return null;
6371
}
64-
return LOOKUP_TABLE[code - 1];
72+
return LOOKUP_TABLE[code];
6573
}
6674

6775
public static String toString(final int code) {
68-
if (code < 1 || code > LOOKUP_TABLE.length) {
76+
if (code < 0 || code >= LOOKUP_TABLE.length || LOOKUP_TABLE[code] == null) {
6977
return Integer.toString(code);
7078
}
71-
return LOOKUP_TABLE[code - 1].name();
79+
return LOOKUP_TABLE[code].name();
7280
}
7381

74-
}
82+
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,9 @@ public RawFrame createWindowUpdate(final int streamId, final int increment) {
111111
return new RawFrame(FrameType.WINDOW_UPDATE.getValue(), 0, streamId, payload);
112112
}
113113

114+
public RawFrame createPriorityUpdate(final ByteBuffer payload) {
115+
// type 0x10, flags 0, streamId 0 (connection control stream)
116+
return new RawFrame(FrameType.PRIORITY_UPDATE.getValue(), 0, 0, payload);
117+
}
118+
114119
}

httpcore5-h2/src/main/java/org/apache/hc/core5/http2/frame/FrameType.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ public enum FrameType {
4242
PING(0x06),
4343
GOAWAY(0x07),
4444
WINDOW_UPDATE(0x08),
45-
CONTINUATION(0x09);
45+
CONTINUATION(0x09),
46+
PRIORITY_UPDATE(0x10); // 16
4647

47-
int value;
48+
final int value;
4849

4950
FrameType(final int value) {
5051
this.value = value;
@@ -54,25 +55,37 @@ public int getValue() {
5455
return value;
5556
}
5657

57-
private static final FrameType[] LOOKUP_TABLE = new FrameType[10];
58+
private static final FrameType[] LOOKUP_TABLE;
5859
static {
59-
for (final FrameType frameType: FrameType.values()) {
60-
LOOKUP_TABLE[frameType.value] = frameType;
60+
int max = -1;
61+
for (final FrameType t : FrameType.values()) {
62+
if (t.value > max) {
63+
max = t.value;
64+
}
65+
}
66+
LOOKUP_TABLE = new FrameType[max + 1];
67+
for (final FrameType t : FrameType.values()) {
68+
LOOKUP_TABLE[t.value] = t;
6169
}
6270
}
6371

6472
public static FrameType valueOf(final int value) {
6573
if (value < 0 || value >= LOOKUP_TABLE.length) {
6674
return null;
6775
}
68-
return LOOKUP_TABLE[value];
76+
return LOOKUP_TABLE[value]; // may be null for gaps (e.g., 0x0A..0x0F)
6977
}
7078

7179
public static String toString(final int value) {
7280
if (value < 0 || value >= LOOKUP_TABLE.length) {
7381
return Integer.toString(value);
7482
}
75-
return LOOKUP_TABLE[value].name();
83+
final FrameType t = LOOKUP_TABLE[value];
84+
return t != null ? t.name() : Integer.toString(value);
7685
}
7786

78-
}
87+
/** Convenience: compare this enum to a raw frame type byte. */
88+
public boolean same(final int rawType) {
89+
return this.value == rawType;
90+
}
91+
}

0 commit comments

Comments
 (0)