mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Add res.client to ClientResponse
This commit is contained in:
@@ -159,17 +159,19 @@ node.http.createServerRequest = function (connection) {
|
||||
// |
|
||||
// v
|
||||
|
||||
createClientResponse = function (connection) {
|
||||
createClientResponse = function (client) {
|
||||
var res = new node.EventEmitter;
|
||||
|
||||
res.connection = connection;
|
||||
res.client = client;
|
||||
res.connection = client;
|
||||
|
||||
res.statusCode = null;
|
||||
res.httpVersion = null;
|
||||
res.headers = [];
|
||||
res.last_was_value = false; // used internally XXX remove me
|
||||
|
||||
res.setBodyEncoding = function (enc) {
|
||||
connection.setEncoding(enc);
|
||||
client.setEncoding(enc);
|
||||
};
|
||||
|
||||
return res;
|
||||
|
||||
@@ -861,6 +861,9 @@ After emitted no other events will be emitted on the response.
|
||||
Set the encoding for the response body. Either +"utf8"+ or +"raw"+.
|
||||
Defaults to raw.
|
||||
|
||||
+response.client+ ::
|
||||
A reference to the +node.http.Client+ that this response belongs to.
|
||||
|
||||
|
||||
|
||||
=== TCP
|
||||
|
||||
Reference in New Issue
Block a user