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

Global agent is being used when pool is specified #596

Merged
merged 1 commit into from
Jul 23, 2013

Conversation

Cauldrath
Copy link
Contributor

When making a request of the form

request({
  uri: "http://localhost:4000",
  pool: {
    maxSockets: 1
  }
}, function(error, response, body) {
});

this.agent is still being set to this.httpModule.globalAgent, and then the global maxSockets is being overwritten with whatever is specified for the pool, which, in this case, is 1.

I'm not sure if this is the best way to check for this, but this change does fix the issue while still leaving an undefined pool as using the global agent and a false agent as not using a pool.

@mikeal
Copy link
Member

mikeal commented Jul 23, 2013

does a regular comparison just work in this case?

i wish we had a test for this.

mikeal added a commit that referenced this pull request Jul 23, 2013
Global agent is being used when pool is specified
@mikeal mikeal merged commit b8495e5 into request:master Jul 23, 2013
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