From abeb41b42fa3cdca99d3f3fef48ea6ee04023d68 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Fri, 18 Aug 2023 12:06:10 +0100 Subject: Minor updates Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/21715) --- crypto/bio/bss_conn.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'crypto') diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 8d29f94bd1..f09160b3c0 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -347,8 +347,7 @@ static int conn_free(BIO *a) return 0; data = (BIO_CONNECT *)a->ptr; - if (data->dgram_bio != NULL) - BIO_free(data->dgram_bio); + BIO_free(data->dgram_bio); if (a->shutdown) { conn_close_socket(a); @@ -372,8 +371,12 @@ static int conn_read(BIO *b, char *out, int outl) return ret; } - if (data->dgram_bio != NULL) - return BIO_read(data->dgram_bio, out, outl); + if (data->dgram_bio != NULL) { + BIO_clear_retry_flags(b); + ret = BIO_read(data->dgram_bio, out, outl); + BIO_set_flags(b, BIO_get_retry_flags(data->dgram_bio)); + return ret; + } if (out != NULL) { clear_socket_error(); @@ -406,8 +409,12 @@ static int conn_write(BIO *b, const char *in, int inl) return ret; } - if (data->dgram_bio != NULL) - return BIO_write(data->dgram_bio, in, inl); + if (data->dgram_bio != NULL) { + BIO_clear_retry_flags(b); + ret = BIO_write(data->dgram_bio, in, inl); + BIO_set_flags(b, BIO_get_retry_flags(data->dgram_bio)); + return ret; + } clear_socket_error(); # ifndef OPENSSL_NO_KTLS -- cgit v1.2.3