HTTP2: Update local flow-controller on Channel.read() if needed (#9400)

Motivation:

We should better update the flow-controller on Channel.read() to reduce overhead and memory overhead.

See https://github.com/netty/netty/pull/9390#issuecomment-513008269

Modifications:

Move updateLocalWindowIfNeeded() to doBeginRead()

Result:

Reduce memory overhead
This commit is contained in:
Norman Maurer 2019-08-16 09:27:47 +02:00
parent f673ba36a0
commit 7a375a492c

View File

@ -751,6 +751,8 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
if (!isActive()) {
return;
}
updateLocalWindowIfNeeded();
switch (readStatus) {
case IDLE:
readStatus = ReadStatus.IN_PROGRESS;
@ -827,8 +829,6 @@ abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements
readStatus = ReadStatus.IDLE;
}
updateLocalWindowIfNeeded();
allocHandle.readComplete();
pipeline().fireChannelReadComplete();
if (config().isAutoRead()) {