diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java index 351b1b2d9c2..dc321136331 100644 --- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java +++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2Client.java @@ -134,6 +134,8 @@ public class HTTP2Client extends ContainerLifeCycle private int maxFrameLength = Frame.DEFAULT_MAX_LENGTH; private int maxConcurrentPushedStreams = 32; private int maxSettingsKeys = SettingsFrame.DEFAULT_MAX_KEYS; + private int maxDynamicTableSize = 4096; + private int maxHeaderBlockFragment = 0; private FlowControlStrategy.Factory flowControlStrategyFactory = () -> new BufferingFlowControlStrategy(0.5F); @Override @@ -372,6 +374,28 @@ public class HTTP2Client extends ContainerLifeCycle this.maxSettingsKeys = maxSettingsKeys; } + @ManagedAttribute("The HPACK dynamic table maximum size") + public int getMaxDynamicTableSize() + { + return maxDynamicTableSize; + } + + public void setMaxDynamicTableSize(int maxDynamicTableSize) + { + this.maxDynamicTableSize = maxDynamicTableSize; + } + + @ManagedAttribute("The max size of header block fragments") + public int getMaxHeaderBlockFragment() + { + return maxHeaderBlockFragment; + } + + public void setMaxHeaderBlockFragment(int maxHeaderBlockFragment) + { + this.maxHeaderBlockFragment = maxHeaderBlockFragment; + } + public void connect(InetSocketAddress address, Session.Listener listener, Promise promise) { connect(null, address, listener, promise); diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java index 8c3e2e99fdd..5d73d33de30 100644 --- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java +++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java @@ -63,7 +63,7 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory @SuppressWarnings("unchecked") Promise promise = (Promise)context.get(SESSION_PROMISE_CONTEXT_KEY); - Generator generator = new Generator(byteBufferPool); + Generator generator = new Generator(byteBufferPool, client.getMaxDynamicTableSize(), client.getMaxHeaderBlockFragment()); FlowControlStrategy flowControl = client.getFlowControlStrategyFactory().newFlowControlStrategy(); HTTP2ClientSession session = new HTTP2ClientSession(scheduler, endPoint, generator, listener, flowControl); session.setMaxRemoteStreams(client.getMaxConcurrentPushedStreams());