summaryrefslogtreecommitdiff
path: root/lib/http2.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-08-08 17:08:38 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-08-08 17:12:26 -0700
commit2126989a32f74dea0476c770f5dda826f12bc457 (patch)
tree1b94a755b01ff764d7d1042abc6af3680b7a70e4 /lib/http2.js
parent0df08c6a0c07a3ec0e63cd34886fafbd87dd3c3b (diff)
downloadandroid-node-v8-2126989a32f74dea0476c770f5dda826f12bc457.tar.gz
android-node-v8-2126989a32f74dea0476c770f5dda826f12bc457.tar.bz2
android-node-v8-2126989a32f74dea0476c770f5dda826f12bc457.zip
Fix test-http-upgrade-server and test-http-parser
Problem was introduced in last http-parser upgrade which fixed a long standing bug with the upgrade event and removed several callbacks.
Diffstat (limited to 'lib/http2.js')
-rw-r--r--lib/http2.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/http2.js b/lib/http2.js
index 7947485e05..be2c9596eb 100644
--- a/lib/http2.js
+++ b/lib/http2.js
@@ -1104,9 +1104,8 @@ ClientRequest.prototype.onSocket = function(socket) {
var res = parser.incoming;
req.res = res;
- // This is start + byteParsed + 1 due to the error of getting \n
- // in the upgradeHead from the closing lines of the headers
- var upgradeHead = d.slice(start + bytesParsed + 1, end);
+ // This is start + byteParsed
+ var upgradeHead = d.slice(start + bytesParsed, end);
if (req.listeners('upgrade').length) {
// Emit 'upgrade' on the Agent.
req.upgraded = true;
@@ -1350,9 +1349,8 @@ function connectionListener(socket) {
var req = parser.incoming;
- // This is start + byteParsed + 1 due to the error of getting \n
- // in the upgradeHead from the closing lines of the headers
- var upgradeHead = d.slice(start + bytesParsed + 1, end);
+ // This is start + byteParsed
+ var upgradeHead = d.slice(start + bytesParsed, end);
if (self.listeners('upgrade').length) {
self.emit('upgrade', req, req.socket, upgradeHead);