debian experimental exim-daemon-heavy config
[exim.git] / src / src / tls-gnu.c
index f2fbeab323c773fe4d5f0e40fd44709f66357090..24114f05e213085d4a0cbc052f878ffa5a8ad8a7 100644 (file)
@@ -3,6 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
+/* Copyright (c) The Exim Maintainers 2020 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Copyright (c) Phil Pennock 2012 */
@@ -3414,22 +3415,21 @@ if (len > INT_MAX)
 if (!more && state->corked)
   {
   DEBUG(D_tls) debug_printf("gnutls_record_uncork(session=%p)\n", state->session);
-  do {
-    do
-      /* We can't use GNUTLS_RECORD_WAIT here, as it retries on
-      GNUTLS_E_AGAIN || GNUTLS_E_INTR, which would break our timeout set by alarm().
-      The GNUTLS_E_AGAIN should not happen ever, as our sockets are blocking anyway.
-      But who knows. (That all relies on the fact that GNUTLS_E_INTR and GNUTLS_E_AGAIN
-      match the EINTR and EAGAIN errno values.) */
-      outbytes = gnutls_record_uncork(state->session, 0);
-    while (outbytes == GNUTLS_E_AGAIN);
-
-     if (outbytes < 0)
-       {
-       record_io_error(state, len, US"uncork", NULL);
-       return -1;
-       }
-  } while (gnutls_record_check_corked(state->session) > 0);
+  do
+    /* We can't use GNUTLS_RECORD_WAIT here, as it retries on
+    GNUTLS_E_AGAIN || GNUTLS_E_INTR, which would break our timeout set by alarm().
+    The GNUTLS_E_AGAIN should not happen ever, as our sockets are blocking anyway.
+    But who knows. (That all relies on the fact that GNUTLS_E_INTR and GNUTLS_E_AGAIN
+    match the EINTR and EAGAIN errno values.) */
+    outbytes = gnutls_record_uncork(state->session, 0);
+  while (outbytes == GNUTLS_E_AGAIN);
+
+  if (outbytes < 0)
+    {
+    record_io_error(state, len, US"uncork", NULL);
+    return -1;
+    }
+
   state->corked = FALSE;
   }
 #endif