3120950b1e
Like the write half, rather than allocating the maximum size needed and relying on the malloc implementation to pool this sanely, allocate the size the TLS record-layer code believes it needs. As currently arranged, this will cause us to alternate from a small allocation (for the record header) and then an allocation sized to the record itself. Windows is reportedly bad at pooling large allocations, so, *if the server sends us smaller records*, this will avoid hitting the problem cases. If the server sends us size 16k records, the maximum allowed by ther protocol, we simply must buffer up to that amount and will continue to allocate similar sizes as before (although slightly smaller; this CL also fixes small double-counting we did on the allocation sizes). Separately, we'll gather some metrics in Chromium to see what common record sizes are to determine if this optimization is sufficient. This is intended as an easy optimization we can do now, in advance of ongoing work to fix the extra layer of buffering between Chromium and BoringSSL with an in-place decrypt API. Bug: chromium:524258 Change-Id: I233df29df1212154c49fee4285ccc37be12f81dc Reviewed-on: https://boringssl-review.googlesource.com/17329 Reviewed-by: Adam Langley <agl@google.com> |
||
---|---|---|
.. | ||
test | ||
bio_ssl.c | ||
CMakeLists.txt | ||
custom_extensions.c | ||
d1_both.c | ||
d1_lib.c | ||
d1_pkt.c | ||
d1_srtp.c | ||
dtls_method.c | ||
dtls_record.c | ||
handshake_client.c | ||
handshake_server.c | ||
internal.h | ||
s3_both.c | ||
s3_lib.c | ||
s3_pkt.c | ||
ssl_aead_ctx.c | ||
ssl_asn1.c | ||
ssl_buffer.c | ||
ssl_cert.c | ||
ssl_cipher.c | ||
ssl_ecdh.c | ||
ssl_file.c | ||
ssl_lib.c | ||
ssl_privkey_cc.cc | ||
ssl_privkey.c | ||
ssl_session.c | ||
ssl_stat.c | ||
ssl_test.cc | ||
ssl_transcript.c | ||
ssl_x509.c | ||
t1_enc.c | ||
t1_lib.c | ||
tls13_both.c | ||
tls13_client.c | ||
tls13_enc.c | ||
tls13_server.c | ||
tls_method.c | ||
tls_record.c |