Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server keep alive to send more than one ping #2315

Merged
merged 2 commits into from
Oct 29, 2020

Conversation

pdcalado
Copy link
Contributor

When enabling HTTP2 server keep alive, only the first ping is sent after the configured interval.
Afterwards, no more pings are sent.

More details on this issue: #2310

The suggested solution checks if ping_sent_at has already been cleared by Ponger::poll when KeepAliveState::PingSent state is active. A test is added to make sure the server produces more than one ping when configured to do so.

Add `http2_keep_alive_count_server_pings` which tests if 3 pings are
received under 5 seconds with keep alive interval set to 1 second.
…ived

`KeepAliveState` did not transition from `PingSent` to `Scheduled` after
a pong was received. This prevented more than one ping to be sent by the
server. This fix checks if `ping_sent_at` has already been cleared by
`Ponger::poll` when `KeepAliveState::PingSent` state is active.

Fixes hyperium#2310
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@seanmonstar seanmonstar merged commit 2a938d9 into hyperium:master Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants