[glib-networking] openssl: clear error before propagating
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] openssl: clear error before propagating
- Date: Thu, 3 Jun 2021 18:49:25 +0000 (UTC)
commit 2d186906b6b96b0026e7b33b1f6acbb64f01b8d3
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date: Wed May 26 13:09:59 2021 +0200
openssl: clear error before propagating
We're telling OpenSSL to retry, storing the error, and obviously once it
retries we might fail and try to store the error again.
tls/openssl/gtlsbio.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/tls/openssl/gtlsbio.c b/tls/openssl/gtlsbio.c
index b138432..ad1efb5 100644
--- a/tls/openssl/gtlsbio.c
+++ b/tls/openssl/gtlsbio.c
@@ -176,6 +176,7 @@ gtls_bio_write (BIO *bio,
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
BIO_set_retry_write (bio);
+ g_clear_error (gbio->write_error);
g_propagate_error (gbio->write_error, error);
}
@@ -218,6 +219,7 @@ gtls_bio_read (BIO *bio,
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
BIO_set_retry_read (bio);
+ g_clear_error (gbio->read_error);
g_propagate_error (gbio->read_error, error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]