fix(http2): gate server Builder
keep-alive interfaces
#3816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
currently, dependents of hyper 0.14 that enable the
server
andhttp2
feature flags will see an error if they enable thebackports
flag.building hyper like so...
...will yield the following errors (shown in "short" format here for brevity):
this stems from the fact that the deprecated connection builder
hyper::server::conn::Builder
and the backportedhyper::server::conn::http2::Builder
both operate on the same internalConfig
structure. this structure has changed slightly between 0.14 and 1.0 however. see:the
runtime
feature flag has since been removed. see: https://docs.rs/hyper/1.5.1/hyper/#optional-featuresthe backported code, consequently, does not include these conditional compilation attributes. i was able to recreate this as far back as v0.14.25, when these backported types were first released.
this commit proposes the addition of
#[cfg(feature = "runtime")]
attributes to thekeep_alive_timeout(..)
andkeep_alive_interval(..)
methods of the backported http/2 server connectionBuilder
.this will allow hyper users that only require the
server
andhttp2
feature flags to address deprecations and prepare to upgrade to hyper 1.0, without having to opt into previously disabled feature flags.