Skip to content

Commit

Permalink
Added check to see if the global pool is being used before using the …
Browse files Browse the repository at this point in the history
…global agent
  • Loading branch information
Cauldrath committed Jul 19, 2013
1 parent c12a116 commit de8508e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ Request.prototype.getAgent = function () {
}
}

if (!poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) {
if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) {
// not doing anything special. Use the globalAgent
return this.httpModule.globalAgent
}
Expand Down

1 comment on commit de8508e

@nemtsov
Copy link

@nemtsov nemtsov commented on de8508e Aug 5, 2013

Choose a reason for hiding this comment

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

I believe this commit is the cause of issue #617 (globalPool not used when maxSockets are set); test is provided in the issue.

Please sign in to comment.