Fix pipelined requests with content-length header. #1

Merged
merged 1 commit into from Nov 12, 2011
Jump to file or symbol
Failed to load files and symbols.
+3 −3
Split
View
@@ -357,7 +357,8 @@ exports.readLen = function (buf, start, len) {
if (this._pendingBytes === 0) {
this.request.emit('end');
- this.mode = 'lastCRLF';
+ req.emit('rawEnd');
+ this.mode = this._shouldKeepAlive ? 'begin' : 'finished';
}
return start + slice.length;
View
@@ -73,8 +73,7 @@ test('keep-alive post', function (t) {
'Host: second.beep',
'Content-Length: 10',
'',
- '0123456789',
- 'POST /third HTTP/1.1',
+ '0123456789POST /third HTTP/1.1',
'Host: third.beep',
'Transfer-Encoding: chunked',
'',