gnutls: fix g_pollable_input_stream_is_readable() implementation
authorDan Winship <danw@gnome.org>
Wed, 8 Dec 2010 18:32:52 +0000 (19:32 +0100)
committerDan Winship <danw@gnome.org>
Wed, 8 Dec 2010 19:42:57 +0000 (20:42 +0100)
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

index 62010ff..f35ae96 100644 (file)
@@ -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;