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

feat: support Keep-Alive Header #275

Merged
merged 5 commits into from Feb 28, 2018
Merged

feat: support Keep-Alive Header #275

merged 5 commits into from Feb 28, 2018

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Feb 27, 2018

@fengmk2
Copy link
Member Author

fengmk2 commented Feb 27, 2018

依赖 node-modules/agentkeepalive#59

lib/urllib.js Outdated
if (agent && agent.keepAlive && agent.freeSocketKeepAliveTimeout > 0 &&
res.headers.connection === 'keep-alive' && res.headers['keep-alive']) {
// adjust freeSocketKeepAliveTimeout on the socket
var m = KEEP_ALIVE_RE.exec(res.headers['keep-alive']);
Copy link
Contributor

Choose a reason for hiding this comment

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

exec 后没 reset ?

Copy link
Member Author

Choose a reason for hiding this comment

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

为何需要 reset?又不是 g 模式

Copy link
Member Author

Choose a reason for hiding this comment

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

image

实际测试是不需要的,index 不会变化

Copy link
Contributor

Choose a reason for hiding this comment

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

恩,global 模式才需要,2 了

- node_js: '0.10'
env: AGENT_VERSION=3
- node_js: '0.12'
env: AGENT_VERSION=3
Copy link
Member Author

Choose a reason for hiding this comment

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

感谢 @popomore 的方式,可以分版本测试了。

@fengmk2 fengmk2 merged commit d6e7c58 into master Feb 28, 2018
@fengmk2 fengmk2 deleted the support-keep-alive-header branch February 28, 2018 05:31
@fengmk2
Copy link
Member Author

fengmk2 commented Feb 28, 2018

2.26.0

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.

None yet

3 participants