Fix incorrect merge choices
This commit is contained in:
parent
01d146c29f
commit
cd8f82c007
22
lib/http.js
22
lib/http.js
@ -116,8 +116,11 @@ function parserOnHeadersComplete(info) {
|
||||
function parserOnBody(b, start, len) {
|
||||
var parser = this;
|
||||
var slice = b.slice(start, start + len);
|
||||
// body encoding is done in _emitData
|
||||
parser.incoming._emitData(slice);
|
||||
if (parser.incoming._paused || parser.incoming._pendings.length) {
|
||||
parser.incoming._pendings.push(slice);
|
||||
} else {
|
||||
parser.incoming._emitData(slice);
|
||||
}
|
||||
}
|
||||
|
||||
function parserOnMessageComplete() {
|
||||
@ -1263,7 +1266,7 @@ function freeParser(parser, req) {
|
||||
if (req) {
|
||||
req.parser = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
ClientRequest.prototype.onSocket = function(socket) {
|
||||
@ -1376,13 +1379,16 @@ ClientRequest.prototype.onSocket = function(socket) {
|
||||
|
||||
var closeListener = function() {
|
||||
debug('HTTP socket close');
|
||||
var req = socket._httpMessage;
|
||||
req.emit('close');
|
||||
if (req.res && req.res.readable) {
|
||||
// Socket closed before we emitted 'end' below.
|
||||
req.res.emit('aborted');
|
||||
var res = req.res;
|
||||
req.res._emitPending(function() {
|
||||
req.res._emitEnd();
|
||||
req.res.emit('close');
|
||||
res._emitEnd();
|
||||
res.emit('close');
|
||||
res = null;
|
||||
});
|
||||
} else if (!req.res && !req._hadError) {
|
||||
// This socket error fired before we started to
|
||||
@ -1532,10 +1538,8 @@ ClientRequest.prototype.setSocketKeepAlive = function() {
|
||||
this._deferToConnect('setKeepAlive', arguments);
|
||||
};
|
||||
|
||||
ClientRequest.prototype.clearTimeout = function() {
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
args.unshift(0);
|
||||
this._deferToConnect('setTimeout', args);
|
||||
ClientRequest.prototype.clearTimeout = function(cb) {
|
||||
this.setTimeout(0, cb);
|
||||
};
|
||||
|
||||
exports.request = function(options, cb) {
|
||||
|
@ -13,7 +13,7 @@ var http = require('http'),
|
||||
done = 0,
|
||||
count = 0,
|
||||
countGC = 0,
|
||||
todo = 500,
|
||||
todo = 400,
|
||||
common = require('../common.js'),
|
||||
assert = require('assert'),
|
||||
PORT = common.PORT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user