Skip to content

Commit

Permalink
Make H2ProtocolConfig interface backward compatible (#2361)
Browse files Browse the repository at this point in the history
Motivation:

#2341 added 3 new methods on `H2ProtocolConfig` interface but didn't
provide default implementations.

Modifications:

- Add default impls for `initialSettings()`, `flowControlQuantum()`,
and `flowControlWindowIncrement()`;

Result:

`H2ProtocolConfig` is backward compatible with 0.42.16 release.
  • Loading branch information
idelpivnitskiy authored Sep 12, 2022
1 parent 07534e9 commit 93ff14e
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ default String alpnId() {
* @return the {@link Http2Settings} that provides a hint for the initial settings. Note that some settings may be
* ignored if not supported (e.g. push promise).
*/
Http2Settings initialSettings();
default Http2Settings initialSettings() { // FIXME: 0.43 - consider removing default impl
throw new UnsupportedOperationException("H2ProtocolConfig#initialSettings() is not supported by " + getClass());
}

/**
* Provide a hint on the number of bytes that the flow controller will attempt to give to a stream for each
Expand All @@ -81,7 +83,10 @@ default String alpnId() {
* streams (if flow control windows become constrained).
* @return number of bytes.
*/
int flowControlQuantum();
default int flowControlQuantum() { // FIXME: 0.43 - consider removing default impl
throw new UnsupportedOperationException("H2ProtocolConfig#flowControlQuantum() is not supported by " +
getClass());
}

/**
* Number of bytes to increment via <a href="https://www.rfc-editor.org/rfc/rfc7540#section-6.9">WINDOW_UPDATE</a>
Expand All @@ -90,7 +95,10 @@ default String alpnId() {
* avoid a single stream consuming all the flow control credits.
* @return The number of bytes to increment the local flow control window for the connection.
*/
int flowControlWindowIncrement();
default int flowControlWindowIncrement() { // FIXME: 0.43 - consider removing default impl
throw new UnsupportedOperationException("H2ProtocolConfig#flowControlWindowIncrement() is not supported by " +
getClass());
}

/**
* A policy for sending <a href="https://tools.ietf.org/html/rfc7540#section-6.7">PING frames</a> to the peer.
Expand Down

0 comments on commit 93ff14e

Please sign in to comment.