From: Fredrik Tolf Date: Wed, 23 Jul 2025 01:33:40 +0000 (+0200) Subject: htparser: Say goodbye properly with GnuTLS. X-Git-Url: http://www.dolda2000.com/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=ashd.git htparser: Say goodbye properly with GnuTLS. --- diff --git a/src/ssl-gnutls.c b/src/ssl-gnutls.c index 5a11f94..57fcdbb 100644 --- a/src/ssl-gnutls.c +++ b/src/ssl-gnutls.c @@ -361,6 +361,12 @@ static void servessl(struct muth *muth, va_list args) ssl.sess = sess; bufinit(ssl.in); serve(bioopen(&ssl, &iofuns), fd, &conn); + while((ret = gnutls_bye(sess, GNUTLS_SHUT_RDWR)) != 0) { + if((ret != GNUTLS_E_INTERRUPTED) && (ret != GNUTLS_E_AGAIN)) + goto out; + if(tlsblock(fd, sess, 60) <= 0) + goto out; + } out: gnutls_deinit(sess);