Fixes #5633 - Allow to configure HttpClient request authority.
Fixed initial session recv window update: it was wrong if the initial value was less than the default value (65535). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
298ddfd722
commit
96e4b38624
|
@ -111,16 +111,12 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory
|
||||||
ISession session = getSession();
|
ISession session = getSession();
|
||||||
|
|
||||||
int windowDelta = client.getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE;
|
int windowDelta = client.getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE;
|
||||||
if (windowDelta > 0)
|
|
||||||
{
|
|
||||||
session.updateRecvWindow(windowDelta);
|
session.updateRecvWindow(windowDelta);
|
||||||
|
if (windowDelta > 0)
|
||||||
session.frames(null, Arrays.asList(prefaceFrame, settingsFrame, new WindowUpdateFrame(0, windowDelta)), this);
|
session.frames(null, Arrays.asList(prefaceFrame, settingsFrame, new WindowUpdateFrame(0, windowDelta)), this);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
session.frames(null, Arrays.asList(prefaceFrame, settingsFrame), this);
|
session.frames(null, Arrays.asList(prefaceFrame, settingsFrame), this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void succeeded()
|
public void succeeded()
|
||||||
|
|
|
@ -376,7 +376,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
||||||
case SettingsFrame.INITIAL_WINDOW_SIZE:
|
case SettingsFrame.INITIAL_WINDOW_SIZE:
|
||||||
{
|
{
|
||||||
if (LOG.isDebugEnabled())
|
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);
|
flowControl.updateInitialStreamWindow(this, value, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,18 +65,12 @@ public class HTTP2ServerSession extends HTTP2Session implements ServerParser.Lis
|
||||||
settings = Collections.emptyMap();
|
settings = Collections.emptyMap();
|
||||||
SettingsFrame settingsFrame = new SettingsFrame(settings, false);
|
SettingsFrame settingsFrame = new SettingsFrame(settings, false);
|
||||||
|
|
||||||
WindowUpdateFrame windowFrame = null;
|
|
||||||
int sessionWindow = getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE;
|
int sessionWindow = getInitialSessionRecvWindow() - FlowControlStrategy.DEFAULT_WINDOW_SIZE;
|
||||||
if (sessionWindow > 0)
|
|
||||||
{
|
|
||||||
updateRecvWindow(sessionWindow);
|
updateRecvWindow(sessionWindow);
|
||||||
windowFrame = new WindowUpdateFrame(0, sessionWindow);
|
if (sessionWindow > 0)
|
||||||
}
|
frames(null, Arrays.asList(settingsFrame, new WindowUpdateFrame(0, sessionWindow)), Callback.NOOP);
|
||||||
|
|
||||||
if (windowFrame == null)
|
|
||||||
frames(null, Collections.singletonList(settingsFrame), Callback.NOOP);
|
|
||||||
else
|
else
|
||||||
frames(null, Arrays.asList(settingsFrame, windowFrame), Callback.NOOP);
|
frames(null, Collections.singletonList(settingsFrame), Callback.NOOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue