Re: nullmailer failing with gnutls >= 3.6.3 under Debian

Bruce Guenter <[email protected]> Thu, 11 Oct 2018 18:14:23 -0600
Newsgroups gmane.mail.nullmailer
Message-ID <[email protected]>
On Fri, Oct 05, 2018 at 03:22:25PM +0200, NullMailer mailing list wrote:
>Seems like nullmailer is having a problem with the new 3.6.4 release of
>gnutls (as well as with 3.6.3 version):
>
>As you can see the send works but the recv gets -28 which means
>GNUTLS_E_AGAIN:

Thanks. I've added a loop to the relevant function in nullmailer:

diff --git a/lib/fdbuf/tlsibuf.cc b/lib/fdbuf/tlsibuf.cc
index 787c323..24b94bd 100644
--- a/lib/fdbuf/tlsibuf.cc
+++ b/lib/fdbuf/tlsibuf.cc
@@ -27,5 +27,10 @@ tlsibuf::tlsibuf(gnutls_session_t s, unsigned bufsz)
 
 ssize_t tlsibuf::_read(char* buf, ssize_t len)
 {
-  return gnutls_record_recv(session, buf, len);
+  int rc;
+  do
+  {
+    rc = gnutls_record_recv(session, buf, len);
+  } while (rc == GNUTLS_E_AGAIN);
+  return rc;
 }


-- 
Bruce Guenter <[email protected]>                https://untroubled.org/