Skip to content

Commit

Permalink
[minor] Buffer writes if the frame to send is made of multiple chunks
Browse files Browse the repository at this point in the history
This allows to write all chunks at the same time via
`Socket.prototype._writev()`.
  • Loading branch information
lpinca committed Mar 15, 2019
1 parent 1842197 commit 6c22584
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sender.js
Expand Up @@ -351,8 +351,10 @@ class Sender {
*/
sendFrame(list, cb) {
if (list.length === 2) {
this._socket.cork();
this._socket.write(list[0]);
this._socket.write(list[1], cb);
this._socket.uncork();
} else {
this._socket.write(list[0], cb);
}
Expand Down

0 comments on commit 6c22584

Please sign in to comment.