Skip to content

Commit

Permalink
Do not have more data in a pipeline than the split_send_fragment
Browse files Browse the repository at this point in the history
We shouldn't be putting more data into a pipeline than the value of
split_send_fragment.

This is a backport of a fix which was included in a much larger commit in
master (c618679) related to moving the pipelining code into the new
record layer that exists there.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#20208)

(cherry picked from commit 2c4b1c7)
  • Loading branch information
mattcaswell authored and bernd-edlinger committed Jul 14, 2023
1 parent 28110f9 commit 6419b67
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ssl/record/rec_layer_s3.c
Expand Up @@ -591,14 +591,13 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, size_t len,
if (numpipes > maxpipes)
numpipes = maxpipes;

if (n / numpipes >= max_send_fragment) {
if (n / numpipes >= split_send_fragment) {
/*
* We have enough data to completely fill all available
* pipelines
*/
for (j = 0; j < numpipes; j++) {
pipelens[j] = max_send_fragment;
}
for (j = 0; j < numpipes; j++)
pipelens[j] = split_send_fragment;
} else {
/* We can partially fill all available pipelines */
tmppipelen = n / numpipes;
Expand Down

0 comments on commit 6419b67

Please sign in to comment.