From 93ad98bf90cf00b767d64a69752e12aef74d2e09 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 23 Jul 2025 03:33:40 +0200 Subject: [PATCH] htparser: Say goodbye properly with GnuTLS. --- src/ssl-gnutls.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.5