Call gnutls_bye() with the GNUTLS_SHUT_WR flag (instead of RDWR) and check
authorJoe Shaw <joe@ximian.com>
Mon, 2 Feb 2004 18:01:28 +0000 (18:01 +0000)
committerJoe Shaw <joeshaw@src.gnome.org>
Mon, 2 Feb 2004 18:01:28 +0000 (18:01 +0000)
2004-02-02  Joe Shaw  <joe@ximian.com>

* libsoup/soup-gnutls.c (soup_gnutls_close): Call gnutls_bye()
with the GNUTLS_SHUT_WR flag (instead of RDWR) and check only for
GNUTLS_E_INTERRUPTED.  GNUTLS_E_AGAIN will be returned by recv()
when there are no messages on the wire on a non-blocking socket.
This sends a SSL hangup message and then allows us to immediately
close the socket.

ChangeLog
libsoup/soup-gnutls.c

index f3ec5a4..143f706 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-02-02  Joe Shaw  <joe@ximian.com>
+
+       * libsoup/soup-gnutls.c (soup_gnutls_close): Call gnutls_bye()
+       with the GNUTLS_SHUT_WR flag (instead of RDWR) and check only for
+       GNUTLS_E_INTERRUPTED.  GNUTLS_E_AGAIN will be returned by recv()
+       when there are no messages on the wire on a non-blocking socket.
+       This sends a SSL hangup message and then allows us to immediately
+       close the socket.
+
 2004-01-30  Rodrigo Moya <rodrigo@ximian.com>
 
        * configure.in: bumped version number to 2.1.6.
index 88ea0cc..319b677 100644 (file)
@@ -247,9 +247,8 @@ soup_gnutls_close (GIOChannel  *channel,
                int ret;
 
                do {
-                       ret = gnutls_bye (chan->session, GNUTLS_SHUT_RDWR);
-               } while (ret == GNUTLS_E_INTERRUPTED ||
-                        ret == GNUTLS_E_AGAIN);
+                       ret = gnutls_bye (chan->session, GNUTLS_SHUT_WR);
+               } while (ret == GNUTLS_E_INTERRUPTED);
        }
 
        return chan->real_sock->funcs->io_close (channel, err);