Skip to content

Commit

Permalink
The Http2Settings max header list size setting is ignored by the conv…
Browse files Browse the repository at this point in the history
…ersion to the actual Netty settings since we only send a setting when the new value is different from the initial value. The initial value is wrong and therefore leads to obtaining the incorrect value.

fixes #4211
  • Loading branch information
vietj committed Dec 21, 2021
1 parent 7e04890 commit 18c1d25
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/http/Http2Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public class Http2Settings {
public static final int DEFAULT_MAX_FRAME_SIZE = 16384;

/**
* Default HTTP/2 spec value for {@link #getMaxHeaderListSize} : {@code Integer.MAX_VALUE}
* Default HTTP/2 spec value for {@link #getMaxHeaderListSize} : {@code 8192}
*/
public static final int DEFAULT_MAX_HEADER_LIST_SIZE = Integer.MAX_VALUE;
public static final int DEFAULT_MAX_HEADER_LIST_SIZE = 8192;

/**
* Default HTTP/2 spec value for {@link #getExtraSettings} : {@code null}
Expand Down
17 changes: 17 additions & 0 deletions src/test/java/io/vertx/core/http/Http2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,23 @@ public void testInitialMaxConcurrentStreamZero() throws Exception {
await();
}

@Test
public void testMaxHaderListSize() throws Exception {
server.close();
server = vertx.createHttpServer(createBaseServerOptions().setInitialSettings(new Http2Settings().setMaxHeaderListSize(Integer.MAX_VALUE - 10 )));
server.requestHandler(req -> {
req.response().end();
});
startServer(testAddress);
client.request(new RequestOptions(requestOptions).setTimeout(10000))
.compose(HttpClientRequest::send)
.onComplete(onSuccess(resp -> {
assertEquals(Integer.MAX_VALUE, resp.request().connection().remoteSettings().getMaxHeaderListSize());
testComplete();
}));
await();
}

@Test
public void testFoo() throws Exception {
waitFor(2);
Expand Down

0 comments on commit 18c1d25

Please sign in to comment.