Unverified Commit fe58bca8 authored by Alba Mendez's avatar Alba Mendez Committed by Beth Griggs
Browse files

tls: group chunks into TLS segments

TLSWrap::DoWrite() now concatenates data chunks and makes a single
call to SSL_write(). Grouping data into a single segment:

- reduces network overhead: by factors of even 2 or 3 in usages
  like `http2` or `form-data`

- improves security: segment lengths can reveal lots of info, i.e.
  with `form-data`, how many fields are sent and the approximate length
  of every individual field and its headers

- reduces encryption overhead: a quick benchmark showed a ~30% CPU time
  decrease for an extreme case, see
  https://github.com/nodejs/node/issues/27573#issuecomment-493787867

Fixes: https://github.com/nodejs/node/issues/27573

Backport-PR-URL: https://github.com/nodejs/node/pull/28904
PR-URL: https://github.com/nodejs/node/pull/27861


Reviewed-By: default avatarFedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarUjjwal Sharma <usharma1998@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent f78ecc3f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment