diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2010-09-22 16:51:53 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-09-23 21:29:20 +0400 |
commit | 5535aa3d51c6af2380540bb5f0908357b76ebd13 (patch) | |
tree | c9f8c9af3a142ebd6b4593ea6d8c897466d27ae1 /lib/http.js | |
parent | 4d0456f827c694e779d7fe754223929554206232 (diff) |
Fixed 'upgrade' event for httpclient
onend and ondata was cleaning on parser end
Diffstat (limited to 'lib/http.js')
-rw-r--r-- | lib/http.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js index 45a71c9b518..e78bda71a0b 100644 --- a/lib/http.js +++ b/lib/http.js @@ -883,7 +883,7 @@ function Client ( ) { }; }; - self.ondata = function (d, start, end) { + function onData(d, start, end) { if (!parser) { throw new Error("parser not initialized prior to Client.ondata call"); } @@ -909,6 +909,10 @@ function Client ( ) { self.addListener("connect", function () { debug('client connected'); + + self.ondata = onData; + self.onend = onEnd; + if (this.https) { this.setSecure(this.credentials); } else { @@ -924,7 +928,7 @@ function Client ( ) { outgoingFlush(self); }); - self.onend = function () { + function onEnd() { if (parser) parser.finish(); debug("self got end closing. readyState = " + self.readyState); self.end(); |