http: delay ret declaration in method _flushOutput
PR-URL: https://github.com/nodejs/node/pull/26562 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
cd8b7391dc
commit
2788fd6b98
@ -791,13 +791,13 @@ OutgoingMessage.prototype._flush = function _flush() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
|
OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
|
||||||
var ret;
|
const outputLength = this.outputData.length;
|
||||||
var outputLength = this.outputData.length;
|
|
||||||
if (outputLength <= 0)
|
if (outputLength <= 0)
|
||||||
return ret;
|
return undefined;
|
||||||
|
|
||||||
var outputData = this.outputData;
|
const outputData = this.outputData;
|
||||||
socket.cork();
|
socket.cork();
|
||||||
|
let ret;
|
||||||
for (var i = 0; i < outputLength; i++) {
|
for (var i = 0; i < outputLength; i++) {
|
||||||
const { data, encoding, callback } = outputData[i];
|
const { data, encoding, callback } = outputData[i];
|
||||||
ret = socket.write(data, encoding, callback);
|
ret = socket.write(data, encoding, callback);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user