GitHub user rschmitt opened a pull request:
https://github.com/apache/httpcomponents-core/pull/91
Interpret HTTP/2 window updates as increments
The `CapacityChannel#update(int)` method accepts a capacity *increment*,
essentially allowing the caller to signal that a certain number of bytes has
just been freed up. However, the HTTP/2 implementation interprets that value as
the *total* buffer capacity, and thus drops all capacity
increments below a certain size, causing the window size to irreversibly
shrink over time.
This change causes HTTP/2 capacity updates to be applied directly to the
input window as increments. Since there exist `AsyncEntityConsumer`
implementations (such as `StringAsyncEntityConsumer`) that supply a capacity of
`Integer.MAX_VALUE`, the `updateWindow` method has been modified to tolerate
integer overflow, instead of throwing an ArithmeticException. This is intended
as an interim measure until the topic of capacity channel update management can
be addressed more comprehensively.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rschmitt/httpcomponents-core master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/httpcomponents-core/pull/91.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #91
----
commit a5348255962438b8f2d9c19a58661e74bb2905cb
Author: Ryan Schmitt <ryansch@...>
Date: 2018-10-12T23:19:17Z
Interpret HTTP/2 window updates as increments
The CapacityChannel#update(int) method accepts a capacity *increment*,
essentially allowing the caller to signal that a certain number of bytes
has just been freed up. However, the HTTP/2 implementation interprets
that value as the *total* buffer capacity, and thus drops all capacity
increments below a certain size, causing the window size to irreversibly
shrink over time.
This change causes HTTP/2 capacity updates to be applied directly to the
input window as increments. Since there exist AsyncEntityConsumer
implementations (such as StringAsyncEntityConsumer) that supply a
capacity of Integer.MAX_VALUE, the `updateWindow` method has been
modified to tolerate integer overflow, instead of throwing an
ArithmeticException. This is intended as an interim measure until the
topic of capacity channel update management can be addressed more
comprehensively.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]