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

Removed Http(s) globalAgent settings #1458

Merged
merged 2 commits into from
Mar 12, 2014
Merged

Conversation

jaw187
Copy link

@jaw187 jaw187 commented Feb 25, 2014

Offloaded maxSockets settings to Nipple. Closes #1346

@hueniverse hueniverse added this to the 2.7.0 milestone Feb 25, 2014
@hueniverse hueniverse self-assigned this Feb 25, 2014
@jaw187
Copy link
Author

jaw187 commented Mar 7, 2014

Simply passing maxSockets to Nipple did not take advantage of connection pooling benefits. Rewrote to create Agent within Hapi and pass that for requests.

@@ -190,8 +190,8 @@ exports = module.exports = internals.Server = function (/* host, port, options *
}

if (this.settings.maxSockets !== null) {
Https.globalAgent.maxSockets = this.settings.maxSockets;
Http.globalAgent.maxSockets = this.settings.maxSockets;
this.settings.agent = (this.settings.tls ? new Https.Agent() : new Http.Agent());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong. The agent type has nothing to do with the server type. What we need is to create both agents.

hueniverse pushed a commit that referenced this pull request Mar 12, 2014
Removed Http(s) globalAgent settings
@hueniverse hueniverse merged commit 0ecb9fe into hapijs:master Mar 12, 2014
@@ -122,7 +122,8 @@ internals.serverSchema = {
views: internals.viewSchema({
engines: Joi.object().required()
}),
maxSockets: Joi.number().allow(null)
maxSockets: Joi.number().allow(null),
agent: Joi.object().allow(null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Even the way you had it, there is no need to allow agent as an external option.

hueniverse pushed a commit that referenced this pull request Mar 12, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

maxSockets trashes global value; not server-specific
2 participants