Only set GTLS errors when errors have occurred
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 26 Apr 2011 17:30:11 +0000 (18:30 +0100)
committerDan Winship <danw@gnome.org>
Tue, 26 Apr 2011 18:14:02 +0000 (14:14 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=648687

tls/gnutls/gtlsconnection-gnutls.c

index d9ba322..5b15910 100644 (file)
@@ -527,7 +527,7 @@ end_gnutls_io (GTlsConnectionGnutls  *gnutls,
             ret == GNUTLS_E_WARNING_ALERT_RECEIVED) && \
            !gnutls->priv->error);                      \
   ret = end_gnutls_io (gnutls, ret, error);            \
-  if (ret && error && !*error)                         \
+  if (ret < 0 && error && !*error)                     \
     {                                                  \
       g_set_error (error, G_TLS_ERROR, G_TLS_ERROR_MISC,\
                    errmsg, gnutls_strerror (ret));     \