summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyatt Preul <wpreul@gmail.com>2013-06-11 15:56:03 -0500
committerisaacs <i@izs.me>2013-07-30 15:06:20 -0700
commit6359e017ac76e971089bcfcffe8dcb921f7f4db4 (patch)
treeaf890d8c01a31603651f1be65fa77d445e883406
parent6327d67be3a939b1ce6ac8541504b1f6fc338fd9 (diff)
downloadnode-6359e017ac76e971089bcfcffe8dcb921f7f4db4.tar.gz
docs: Warning about consuming response
-rw-r--r--doc/api/http.markdown12
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
index e93aa2d2d..a1b1a598d 100644
--- a/doc/api/http.markdown
+++ b/doc/api/http.markdown
@@ -315,7 +315,7 @@ Boolean (read-only). True if headers were sent, false otherwise.
### response.sendDate
-When true, the Date header will be automatically generated and sent in
+When true, the Date header will be automatically generated and sent in
the response if it is not already present in the headers. Defaults to true.
This should only be disabled for testing; HTTP requires the Date header
@@ -526,17 +526,17 @@ Alternatively, you could just opt out of pooling entirely using `agent:false`:
### agent.maxSockets
-By default set to 5. Determines how many concurrent sockets the agent can have
+By default set to 5. Determines how many concurrent sockets the agent can have
open per host.
### agent.sockets
-An object which contains arrays of sockets currently in use by the Agent. Do not
+An object which contains arrays of sockets currently in use by the Agent. Do not
modify.
### agent.requests
-An object which contains queues of requests that have not yet been assigned to
+An object which contains queues of requests that have not yet been assigned to
sockets. Do not modify.
## http.globalAgent
@@ -566,7 +566,9 @@ entirely discarded. However, if you add a `'response'` event handler,
then you **must** consume the data from the response object, either by
calling `response.read()` whenever there is a `'readable'` event, or
by adding a `'data'` handler, or by calling the `.resume()` method.
-Until the data is consumed, the `'end'` event will not fire.
+Until the data is consumed, the `'end'` event will not fire. Also, until
+the data is read it will consume memory that can eventually lead to a
+'process out of memory' error.
Note: Node does not check whether Content-Length and the length of the body
which has been transmitted are equal or not.