summaryrefslogtreecommitdiff
path: root/lib/_http_agent.js
AgeCommit message (Collapse)Author
2015-09-15http: default Agent.getName to 'localhost'Malcolm Ahoy
Refactor out the if/else statement checking for option.host. Add whitespace to make concatenation chunks more readable and consistent with the https version of Agent.getName(). PR-URL: https://github.com/nodejs/node/pull/2825 Reviewed-By: Julian Duque <julianduquej@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-08-04http: fix agent.getName() and add testsBrendan Ashworth
This commit fixes agent.getName(), which returned an extra colon according to the docs, and adds tests (it was previously not unit tested). PR-URL: https://github.com/nodejs/io.js/pull/1617 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-27https: reuse TLS sessions in AgentFedor Indutny
Fix: #1499 PR-URL: https://github.com/nodejs/io.js/pull/2228 Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-04-17http: logically respect maxSocketsfengmk2
Allows the number of pooled free sockets to equal maxSockets. Previously it would only allow maxSockets - 1. PR-URL: https://github.com/iojs/io.js/pull/1242 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Christian Tellnes <christian@tellnes.no>
2015-03-10https: don't overwrite servername optionskenqbx
PR-URL: https://github.com/iojs/io.js/pull/1110 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-01-21lib: use const to define constantscjihrig
This commit replaces a number of var statements throughout the lib code with const statements. PR-URL: https://github.com/iojs/io.js/pull/541 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2014-11-22lib: turn on strict modeBen Noordhuis
Turn on strict mode for the files in the lib/ directory. It helps catch bugs and can have a positive effect on performance. PR-URL: https://github.com/node-forward/node/pull/64 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-05lib: improved forEach object performanceMajid Arif Siddiqui
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-02-26http: remove the circular dependencyNathan Rajlich
Between `ClientRequest` and `Agent`. The circular require was doing weird things at load time, like making the `globalAgent` property be `undefined` from within the context of the "_http_client" module. Removing the circular dependency completely fixes this. This commit effectively removes the undocumented `Agent#request()` and `Agent#get()` functions.
2013-11-07http: force socket encoding to be nullisaacs
Otherwise the string triggers an assertion error in node_http_parser.c, line 370: assert(Buffer::HasInstance(args[0]) == true); because the first argument is not a Buffer object.
2013-11-07http: cleanup freeSockets when socket destroyedfengmk2
If the socket was destroyed, we need to remove it from the agent's `freeSockets` list, otherwise dead socket could be reused by new request.
2013-09-14http: don't pass the request options to AgentNathan Rajlich
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-08-15lib: remove unused variables and functionsBrian White
2013-08-15http: add agent.maxFreeSockets optionisaacs
2013-08-07http: Support legacy agent.addRequest APIisaacs
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-05http: Fix overlooked agent.globalAgent exportisaacs
Noticed by @bnoordhuis in https://github.com/joyent/node/pull/5991#discussion_r5575946
2013-08-01src: Replace macros with util functionsisaacs
2013-07-24lib: macro-ify type checksBen Noordhuis
Increases the grep factor. Makes it easier to harmonize type checks across the code base.
2013-07-09http: Reuse more http/https Agent codeisaacs
2013-07-09http: Add agent.get/request methodsisaacs
2013-07-09http: Proper KeepAlive behaviorisaacs
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-09http: styleisaacs
2013-04-17http: split Agent into its own fileTimothy J Fontaine