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 388599be9b1d..8c3e2e99fdd1 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 @@ -111,15 +111,11 @@ public void onOpen() ISession session = getSession(); int windowDelta = client.getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE; + session.updateRecvWindow(windowDelta); if (windowDelta > 0) - { - session.updateRecvWindow(windowDelta); session.frames(null, Arrays.asList(prefaceFrame, settingsFrame, new WindowUpdateFrame(0, windowDelta)), this); - } else - { session.frames(null, Arrays.asList(prefaceFrame, settingsFrame), this); - } } @Override diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java index e9c22320cf8c..ecee9d19988f 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java @@ -376,7 +376,7 @@ public void onSettings(SettingsFrame frame, boolean reply) case SettingsFrame.INITIAL_WINDOW_SIZE: { if (LOG.isDebugEnabled()) - LOG.debug("Updating initial window size to {} for {}", value, this); + LOG.debug("Updating initial stream window size to {} for {}", value, this); flowControl.updateInitialStreamWindow(this, value, false); break; } diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java index 6e87bf176758..26808f8fd6da 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerSession.java @@ -65,18 +65,12 @@ public void onPreface() settings = Collections.emptyMap(); SettingsFrame settingsFrame = new SettingsFrame(settings, false); - WindowUpdateFrame windowFrame = null; int sessionWindow = getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE; + updateRecvWindow(sessionWindow); if (sessionWindow > 0) - { - updateRecvWindow(sessionWindow); - windowFrame = new WindowUpdateFrame(0, sessionWindow); - } - - if (windowFrame == null) - frames(null, Collections.singletonList(settingsFrame), Callback.NOOP); + frames(null, Arrays.asList(settingsFrame, new WindowUpdateFrame(0, sessionWindow)), Callback.NOOP); else - frames(null, Arrays.asList(settingsFrame, windowFrame), Callback.NOOP); + frames(null, Collections.singletonList(settingsFrame), Callback.NOOP); } @Override