Skip to content

Commit

Permalink
stream: inline unbuffered _write
Browse files Browse the repository at this point in the history
PR-URL: #32886
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
ronag authored and BethGriggs committed Apr 27, 2020
1 parent 2ab4ebc commit 7f49812
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) {
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}

// Return false if errored or destroyed in order to break
Expand Down

0 comments on commit 7f49812

Please sign in to comment.