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

add support for keep-alive timeout server hint #275

Merged
merged 3 commits into from
Jul 30, 2020
Merged

Conversation

ronag
Copy link
Member

@ronag ronag commented Jul 30, 2020

No description provided.

@ronag ronag requested a review from mcollina July 30, 2020 11:43
@ronag
Copy link
Member Author

ronag commented Jul 30, 2020

@szmarczak

@ronag ronag force-pushed the keep-alive-timeout branch 4 times, most recently from be8a436 to e79c2dc Compare July 30, 2020 11:46
@ronag
Copy link
Member Author

ronag commented Jul 30, 2020

nodejs/node#34560

@ronag ronag force-pushed the keep-alive-timeout branch 2 times, most recently from 70c3d85 to 48b7dfe Compare July 30, 2020 11:55
@ronag ronag force-pushed the keep-alive-timeout branch from 48b7dfe to b1d98a4 Compare July 30, 2020 12:03
lib/client.js Show resolved Hide resolved
lib/client.js Show resolved Hide resolved
lib/client.js Outdated Show resolved Hide resolved
lib/client.js Outdated Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm, I like this.

@ronag ronag merged commit 27754e9 into master Jul 30, 2020
@ronag ronag deleted the keep-alive-timeout branch July 30, 2020 14:36
if (m) {
const keepAliveTimeout = Number(m[1]) * 1000
// Set timeout to half of hint to account for timing inaccuracies.
client[kKeepAliveTimeout] = Math.min(keepAliveTimeout - 500, client[kIdleTimeout])
Copy link
Member

Choose a reason for hiding this comment

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

What is this is negative or a zero? Does it throw?

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.

3 participants