From: Jeremy Harris Date: Mon, 28 Jun 2021 21:17:22 +0000 (+0100) Subject: LibreSSL: TLS-write-shutdown does not push data X-Git-Tag: exim-4.95-RC0~7 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/9fabc8c7e29cb421b19ed4a3def77209193a3529 LibreSSL: TLS-write-shutdown does not push data --- diff --git a/src/src/exim.h b/src/src/exim.h index 8bbeecb4d..484276bb2 100644 --- a/src/src/exim.h +++ b/src/src/exim.h @@ -659,5 +659,13 @@ default to EDQUOT if it exists, otherwise ENOSPC. */ # define EXIM_TCP_CORK TCP_NOPUSH #endif +/* LibreSSL seems to not push out the SMTP response to QUIT with our usual +handling which is trying to get the client to FIN first so that the server does +not get the TIME_WAIT */ + +#if !defined(DISABLE_TLS) && defined(USE_OPENSSL) && defined(LIBRESSL_VERSION_NUMBER) +# define SERVERSIDE_CLOSE_NOWAIT +#endif + #endif /* End of exim.h */ diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index dfb4a9284..3210e596c 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -4102,7 +4102,7 @@ else sx->send_quit = FALSE; /* avoid sending it later */ #ifndef DISABLE_TLS - if (sx->cctx.tls_ctx) /* need to send TLS Cloe Notify */ + if (sx->cctx.tls_ctx) /* need to send TLS Close Notify */ { # ifdef EXIM_TCP_CORK /* Use _CORK to get Close Notify in FIN segment */ (void) setsockopt(sx->cctx.sock, IPPROTO_TCP, EXIM_TCP_CORK, US &on, sizeof(on));