FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add res.client to ClientResponse · objcode/node@996d5ef · GitHub

Commit 996d5ef

Browse files
committed
Add res.client to ClientResponse
1 parent c5ab0d5 commit 996d5ef

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎src/http.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,19 @@ node.http.createServerRequest = function (connection) {
159159
// |
160160
// v
161161

162-
createClientResponse = function (connection) {
162+
createClientResponse = function (client) {
163163
var res = new node.EventEmitter;
164164

165-
res.connection = connection;
165+
res.client = client;
166+
res.connection = client;
167+
166168
res.statusCode = null;
167169
res.httpVersion = null;
168170
res.headers = [];
169171
res.last_was_value = false; // used internally XXX remove me
170172

171173
res.setBodyEncoding = function (enc) {
172-
connection.setEncoding(enc);
174+
client.setEncoding(enc);
173175
};
174176

175177
return res;

‎website/api.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,9 @@ After emitted no other events will be emitted on the response.
861861
Set the encoding for the response body. Either +"utf8"+ or +"raw"+.
862862
Defaults to raw.
863863

864+
+response.client+ ::
865+
A reference to the +node.http.Client+ that this response belongs to.
866+
864867

865868

866869
=== TCP

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL