Lazily initialise the compression buffer
authorMatt Caswell <matt@openssl.org>
Wed, 13 Jan 2016 11:44:04 +0000 (11:44 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 7 Mar 2016 21:39:27 +0000 (21:39 +0000)
commit0220fee47f912c9c89efe24c09e10f4d452a4d42
tree09acd16b45de65d81c35b689afd3ee608be9d430
parent94777c9c86a2b2ea2726c49d6c8f61078558beba
Lazily initialise the compression buffer

With read pipelining we use multiple SSL3_RECORD structures for reading.
There are SSL_MAX_PIPELINES (32) of them defined (typically not all of these
would be used). Each one has a 16k compression buffer allocated! This
results in a significant amount of memory being consumed which, most of the
time, is not needed.  This change swaps the allocation of the compression
buffer to be lazy so that it is only done immediately before it is actually
used.

Reviewed-by: Tim Hudson <tjh@openssl.org>
ssl/record/rec_layer_s3.c
ssl/record/record.h
ssl/record/record_locl.h
ssl/record/ssl3_record.c
ssl/s3_enc.c
ssl/t1_enc.c