[glib-networking/mcatanzaro/#20: 1/6] Account for ongoing ops in check function
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/#20: 1/6] Account for ongoing ops in check function
- Date: Sun, 26 Jan 2020 20:50:12 +0000 (UTC)
commit 5b7e37f62580a2128c95511f1e74bc880d671c21
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Jan 26 14:24:22 2020 -0600
Account for ongoing ops in check function
If we have a conflicting po in progress, then we are not ready to read
or write.
tls/base/gtlsconnection-base.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index 637d785..a4e5d43 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -901,14 +901,12 @@ g_tls_connection_base_check (GTlsConnectionBase *tls,
if (priv->need_finish_handshake)
return TRUE;
- /* If a handshake or close is in progress, then tls_istream and
- * tls_ostream are blocked, regardless of the base stream status.
+ /* If op or close is in progress, then tls_istream and tls_ostream are
+ * blocked, regardless of the base stream status. Note this also
+ * accounts for handshake ops.
*/
- if (priv->handshaking)
- return FALSE;
-
- if (((condition & G_IO_IN) && priv->read_closing) ||
- ((condition & G_IO_OUT) && priv->write_closing))
+ if (((condition & G_IO_IN) && (priv->reading || priv->read_closing)) ||
+ ((condition & G_IO_OUT) && (priv->writing || priv->write_closing)))
return FALSE;
/* Defer to the base stream or GDatagramBased. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]