Don't send a window update if the length is zero.

This commit is contained in:
Simone Bordet 2014-08-08 01:09:18 +02:00
parent 6dfa452e29
commit 69927b935e
1 changed files with 7 additions and 3 deletions

View File

@ -99,9 +99,13 @@ public class HTTP2FlowControl implements FlowControl
if (LOG.isDebugEnabled())
LOG.debug("Data consumed, increasing window by {} for {}", length, stream);
// Negative streamId allow for generation of bytes for both stream and session
WindowUpdateFrame frame = new WindowUpdateFrame(-stream.getId(), length);
stream.getSession().control(stream, frame, Callback.Adapter.INSTANCE);
if (length > 0)
{
// Negative streamId allow for generation of bytes for both stream and session
WindowUpdateFrame frame = new WindowUpdateFrame(-stream.getId(), length);
stream.getSession().control(stream, frame, Callback.Adapter.INSTANCE);
}
}
@Override