]> www.dolda2000.com Git - ashd.git/commitdiff
htparser: Say goodbye properly with GnuTLS. master
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 23 Jul 2025 01:33:40 +0000 (03:33 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 23 Jul 2025 01:33:40 +0000 (03:33 +0200)
src/ssl-gnutls.c

index 5a11f94c6870df4d66f4b8d2f64c5c18fa0ce8a3..57fcdbb4cce6a94b4f380c583fe7efd2be8cb9b2 100644 (file)
@@ -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);