openssl: reduce memory consumption
authorBert Belder <bertbelder@gmail.com>
Tue, 11 Sep 2012 19:33:15 +0000 (21:33 +0200)
committerBert Belder <bertbelder@gmail.com>
Wed, 12 Sep 2012 03:23:47 +0000 (05:23 +0200)
commitff22a0cb15c0513c0f40367f46de69da0056097d
tree8ec5938230ea6bb7a89c4f63346d38f82f617904
parentb61ae54e18c9f6ada7e746052ef6b39272b18a15
openssl: reduce memory consumption

SSL records may be as large as 16K, but are typically < 2K.  In
addition, a historic bug in Windows allowed records to be as large
32K.  OpenSSL statically allocates read and write buffers (34K and
18K respectively) used for processing records.

With this patch, OpenSSL statically allocates 4K + 4K buffers, with
the option of dynamically growing buffers to 34K + 4K, which is a
saving of 44K per connection for the typical case.

This patch is taken from the Android Open Source Project.
deps/openssl/openssl/ssl/d1_pkt.c
deps/openssl/openssl/ssl/s23_srvr.c
deps/openssl/openssl/ssl/s3_both.c
deps/openssl/openssl/ssl/s3_pkt.c
deps/openssl/openssl/ssl/ssl.h
deps/openssl/openssl/ssl/ssl3.h
deps/openssl/openssl/ssl/ssltest.c
deps/openssl/openssl/test/testssl