Implement read pipeline support in libssl
authorMatt Caswell <matt@openssl.org>
Tue, 12 Jan 2016 14:52:35 +0000 (14:52 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 7 Mar 2016 21:39:27 +0000 (21:39 +0000)
commit94777c9c86a2b2ea2726c49d6c8f61078558beba
treea0c4cc27b76e5e4044bdb34c21dd1f298af8094d
parent2f2c9caa727d7d2a5ce4bfb8266e019546ce77df
Implement read pipeline support in libssl

Read pipelining is controlled in a slightly different way than with write
pipelining. While reading we are constrained by the number of records that
the peer (and the network) can provide to us in one go. The more records
we can get in one go the more opportunity we have to parallelise the
processing.

There are two parameters that affect this:
* The number of pipelines that we are willing to process in one go. This is
controlled by max_pipelines (as for write pipelining)
* The size of our read buffer. A subsequent commit will provide an API for
adjusting the size of the buffer.

Another requirement for this to work is that "read_ahead" must be set. The
read_ahead parameter will attempt to read as much data into our read buffer
as the network can provide. Without this set, data is read into the read
buffer on demand. Setting the max_pipelines parameter to a value greater
than 1 will automatically also turn read_ahead on.

Finally, the read pipelining as currently implemented will only parallelise
the processing of application data records. This would only make a
difference for renegotiation so is unlikely to have a significant impact.

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