Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2015-03-11 16:11:16 +0000
committerSimone Bordet2015-03-11 16:11:16 +0000
commit1dbf2be343240556ba2a0f8391531ffd560251e5 (patch)
treedda90eca4cd9cd8413d2976db49fa4f509296143 /jetty-http2
parent560ec6301e99f5ac4d546c514e19a7c3f893be77 (diff)
downloadorg.eclipse.jetty.project-1dbf2be343240556ba2a0f8391531ffd560251e5.tar.gz
org.eclipse.jetty.project-1dbf2be343240556ba2a0f8391531ffd560251e5.tar.xz
org.eclipse.jetty.project-1dbf2be343240556ba2a0f8391531ffd560251e5.zip
423974 - Optimize flow control.
Don't send the window update if the stream is closed.
Diffstat (limited to 'jetty-http2')
-rw-r--r--jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/SimpleFlowControlStrategy.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/SimpleFlowControlStrategy.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/SimpleFlowControlStrategy.java
index 450529f2b1..3714503fe3 100644
--- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/SimpleFlowControlStrategy.java
+++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/SimpleFlowControlStrategy.java
@@ -52,11 +52,19 @@ public class SimpleFlowControlStrategy extends AbstractFlowControlStrategy
Frame[] streamFrame = Frame.EMPTY_ARRAY;
if (stream != null)
{
- streamFrame = new Frame[1];
- streamFrame[0] = new WindowUpdateFrame(stream.getId(), length);
- stream.updateRecvWindow(length);
- if (LOG.isDebugEnabled())
- LOG.debug("Data consumed, increased stream recv window by {} for {}", length, stream);
+ if (stream.isClosed())
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Data consumed, ignoring update stream recv window by {} for closed {}", length, stream);
+ }
+ else
+ {
+ streamFrame = new Frame[1];
+ streamFrame[0] = new WindowUpdateFrame(stream.getId(), length);
+ stream.updateRecvWindow(length);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Data consumed, increased stream recv window by {} for {}", length, stream);
+ }
}
session.control(stream, Callback.Adapter.INSTANCE, sessionFrame, streamFrame);

Back to the top