Commit Graph

12 Commits

Author SHA1 Message Date
Nathan Rajlich
f31037ddfe http: don't pass the request options to Agent
The `options` that were being passed in before here are specific to a
single request, which kinda defeats the purpose of using an Agent in the
first place.

On a worse note, these `options` have not yet been "processed" by the
`http.ClientRequest` class, so if `port: null` is set (like it is as the
result of a `url.parse()` call), then they take preference over the
processed values since the agent's "options" get mixed in last in the
`createSocket()` function.

Fixes #6197.
Fixes #6199.
Closes #6231.
2013-09-14 12:29:48 -07:00
Brian White
6d842897c5 lib: remove unused variables and functions 2013-08-15 17:19:17 -07:00
isaacs
65f6f06a61 http: add agent.maxFreeSockets option 2013-08-15 13:54:28 -07:00
isaacs
12cd13312b http: Support legacy agent.addRequest API
There are some agent subclasses using this today.

Despite the addRequest function being undocumented internal API, it's
easy enough to just support the old signature for backwards
compatibility.
2013-08-07 10:29:15 -07:00
isaacs
32fdae2ca3 http: Fix overlooked agent.globalAgent export
Noticed by @bnoordhuis in https://github.com/joyent/node/pull/5991#discussion_r5575946
2013-08-05 12:33:19 -07:00
isaacs
22c68fdc1d src: Replace macros with util functions 2013-08-01 15:08:01 -07:00
Ben Noordhuis
0330bdf519 lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
2013-07-24 21:49:35 +02:00
isaacs
49519f1217 http: Reuse more http/https Agent code 2013-07-09 22:31:11 -07:00
isaacs
40e92650bb http: Add agent.get/request methods 2013-07-09 22:31:11 -07:00
isaacs
9fc9b87472 http: Proper KeepAlive behavior
Instead of destroying sockets when there are no pending requests, put
them in a freeSockets list, and unref() them so that they do not keep
the event loop open.

Also, set the default max sockets to Infinity, to prevent the awful
surprising deadlocks that happen when more connections are made.
2013-07-09 22:31:11 -07:00
isaacs
6176e49181 http: style 2013-07-09 22:31:11 -07:00
Timothy J Fontaine
62e4f89765 http: split Agent into its own file 2013-04-17 00:08:28 +02:00