http: Simplify IncomingMessage._dump method
This commit is contained in:
parent
7c9b607048
commit
df23ce138f
@ -23,14 +23,14 @@ var util = require('util');
|
|||||||
var Stream = require('stream');
|
var Stream = require('stream');
|
||||||
|
|
||||||
function readStart(socket) {
|
function readStart(socket) {
|
||||||
if (!socket || !socket._handle || !socket._handle.readStart) return;
|
if (socket)
|
||||||
socket._handle.readStart();
|
socket.resume();
|
||||||
}
|
}
|
||||||
exports.readStart = readStart;
|
exports.readStart = readStart;
|
||||||
|
|
||||||
function readStop(socket) {
|
function readStop(socket) {
|
||||||
if (!socket || !socket._handle || !socket._handle.readStop) return;
|
if (socket)
|
||||||
socket._handle.readStop();
|
socket.pause();
|
||||||
}
|
}
|
||||||
exports.readStop = readStop;
|
exports.readStop = readStop;
|
||||||
|
|
||||||
@ -196,9 +196,6 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) {
|
|||||||
IncomingMessage.prototype._dump = function() {
|
IncomingMessage.prototype._dump = function() {
|
||||||
if (!this._dumped) {
|
if (!this._dumped) {
|
||||||
this._dumped = true;
|
this._dumped = true;
|
||||||
if (this.socket.parser) this.socket.parser.incoming = null;
|
this.resume();
|
||||||
this.push(null);
|
|
||||||
readStart(this.socket);
|
|
||||||
this.read();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -58,9 +58,6 @@ var httpServer = http.createServer(function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
httpServer.listen(common.PORT, function() {
|
httpServer.listen(common.PORT, function() {
|
||||||
// XXX(isaacs): This should not be necessary.
|
http.get({ port: common.PORT });
|
||||||
http.get({ port: common.PORT }, function(res) {
|
|
||||||
res.resume();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user