From 560ec6301e99f5ac4d546c514e19a7c3f893be77 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 11 Mar 2015 16:27:31 +0100 Subject: [PATCH] 423974 - Optimize flow control. Made the buffering flow control strategy the default. --- .../jetty/http2/client/HTTP2ClientConnectionFactory.java | 4 ++-- .../http2/server/AbstractHTTP2ServerConnectionFactory.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 0be731dcb1a..bd4d9eb0feb 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 @@ -23,10 +23,10 @@ import java.util.Collections; import java.util.Map; import java.util.concurrent.Executor; +import org.eclipse.jetty.http2.BufferingFlowControlStrategy; import org.eclipse.jetty.http2.FlowControlStrategy; import org.eclipse.jetty.http2.HTTP2Connection; import org.eclipse.jetty.http2.ISession; -import org.eclipse.jetty.http2.SimpleFlowControlStrategy; import org.eclipse.jetty.http2.api.Session; import org.eclipse.jetty.http2.frames.PrefaceFrame; import org.eclipse.jetty.http2.frames.SettingsFrame; @@ -72,7 +72,7 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory protected FlowControlStrategy newFlowControlStrategy() { - return new SimpleFlowControlStrategy(); + return new BufferingFlowControlStrategy(0.5F); } public int getInitialSessionRecvWindow() diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java index 83c135b2181..c9aeb362666 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java @@ -20,9 +20,9 @@ package org.eclipse.jetty.http2.server; import java.util.Objects; +import org.eclipse.jetty.http2.BufferingFlowControlStrategy; import org.eclipse.jetty.http2.FlowControlStrategy; import org.eclipse.jetty.http2.HTTP2Connection; -import org.eclipse.jetty.http2.SimpleFlowControlStrategy; import org.eclipse.jetty.http2.api.server.ServerSessionListener; import org.eclipse.jetty.http2.generator.Generator; import org.eclipse.jetty.http2.parser.Parser; @@ -112,7 +112,7 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne protected FlowControlStrategy newFlowControlStrategy() { - return new SimpleFlowControlStrategy(getInitialStreamSendWindow()); + return new BufferingFlowControlStrategy(getInitialStreamSendWindow(), 0.5F); } protected abstract ServerSessionListener newSessionListener(Connector connector, EndPoint endPoint);