From ef972798309087651a4976d02f02510b995a527a Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Mon, 2 Feb 2004 18:01:28 +0000 Subject: [PATCH] Call gnutls_bye() with the GNUTLS_SHUT_WR flag (instead of RDWR) and check 2004-02-02 Joe Shaw * 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 | 9 +++++++++ libsoup/soup-gnutls.c | 5 ++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3ec5a4..143f706 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-02-02 Joe Shaw + + * 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 * configure.in: bumped version number to 2.1.6. diff --git a/libsoup/soup-gnutls.c b/libsoup/soup-gnutls.c index 88ea0cc..319b677 100644 --- a/libsoup/soup-gnutls.c +++ b/libsoup/soup-gnutls.c @@ -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); -- 2.7.4