aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bio/bss_dgram_pair.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/bio/bss_dgram_pair.c b/crypto/bio/bss_dgram_pair.c
index 3685d51f55..393af7dab4 100644
--- a/crypto/bio/bss_dgram_pair.c
+++ b/crypto/bio/bss_dgram_pair.c
@@ -265,7 +265,7 @@ struct bio_dgram_pair_st {
unsigned int no_trunc : 1; /* Reads fail if they would truncate */
unsigned int local_addr_enable : 1; /* Can use BIO_MSG->local? */
unsigned int role : 1; /* Determines lock order */
- unsigned int fixed_size : 1; /* Affects BIO_s_dgram_mem only */
+ unsigned int grows_on_write : 1; /* Set for BIO_s_dgram_mem only */
};
#define MIN_BUF_LEN (1024)
@@ -306,6 +306,8 @@ static int dgram_mem_init(BIO *bio)
return 0;
}
+ b->grows_on_write = 1;
+
bio->init = 1;
return 1;
}
@@ -469,7 +471,7 @@ static int dgram_pair_ctrl_set_write_buf_size(BIO *bio, size_t len)
}
b->req_buf_len = len;
- b->fixed_size = 1;
+ b->grows_on_write = 0;
return 1;
}
@@ -1145,7 +1147,8 @@ static ossl_inline size_t compute_rbuf_growth(size_t target, size_t current)
}
/* Must hold local write lock */
-static size_t dgram_pair_write_inner(struct bio_dgram_pair_st *b, const uint8_t *buf, size_t sz)
+static size_t dgram_pair_write_inner(struct bio_dgram_pair_st *b,
+ const uint8_t *buf, size_t sz)
{
size_t total_written = 0;
@@ -1166,7 +1169,7 @@ static size_t dgram_pair_write_inner(struct bio_dgram_pair_st *b, const uint8_t
if (dst_len == 0) {
size_t new_len;
- if (!b->fixed_size) /* resizeable only unless size not set explicitly */
+ if (!b->grows_on_write) /* resize only if size not set explicitly */
break;
/* increase the size */
new_len = compute_rbuf_growth(b->req_buf_len + sz, b->req_buf_len);