[glib-networking] gnutls: fix g_pollable_input_stream_is_readable() implementation



commit 09cd9d0414f40c3f5a9c6ded4908d3ff7d1c6dde
Author: Dan Winship <danw gnome org>
Date:   Wed Dec 8 19:32:52 2010 +0100

    gnutls: fix g_pollable_input_stream_is_readable() implementation
    
    Don't test the underlying input stream for readability unless a
    previous read attempt returned EAGAIN; gnutls may be buffering data
    internally, so we have to just assume we're readable until we see an
    EAGAIN.

 tls/gnutls/gtlsconnection-gnutls.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 62010ff..f35ae96 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -535,6 +535,9 @@ gboolean
 g_tls_connection_gnutls_check (GTlsConnectionGnutls  *gnutls,
 			       GIOCondition           condition)
 {
+  if (!gnutls->priv->internal_direction)
+    return TRUE;
+
   if (gnutls->priv->handshaking || gnutls->priv->closing)
     condition = gnutls->priv->internal_direction;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]