From 996d5ef5f10a26130eddf94dd508328fa1f04b34 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 12 Jul 2009 11:48:37 +0200 Subject: [PATCH] Add res.client to ClientResponse --- src/http.js | 8 +++++--- website/api.txt | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/http.js b/src/http.js index 126a2a1f56..63e2131425 100644 --- a/src/http.js +++ b/src/http.js @@ -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; diff --git a/website/api.txt b/website/api.txt index 91a5277b26..f463e37ac0 100644 --- a/website/api.txt +++ b/website/api.txt @@ -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