From: Jeremy Harris Date: Mon, 5 Apr 2021 12:41:50 +0000 (+0100) Subject: Disable server-side close timing sophistication on MacOS X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/9f84d5d5eb8d2f15f9bef6d4d662a4dc5f17219c Disable server-side close timing sophistication on MacOS Broken-by: 001bf8f587 --- diff --git a/src/OS/os.h-Darwin b/src/OS/os.h-Darwin index 1a557d829..a85e92f05 100644 --- a/src/OS/os.h-Darwin +++ b/src/OS/os.h-Darwin @@ -56,4 +56,9 @@ in "man 2 getgroups". */ rather than a modified sendto() */ #define EXIM_TFO_CONNECTX +/* MacOS, at least on the buildfarm animal, does not seem to 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 */ +#define SERVERSIDE_CLOSE_NOWAIT + /* End */ diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 5888b8037..2bb15b698 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -3847,9 +3847,18 @@ if (*user_msgp) else smtp_printf("221 %s closing connection\r\n", FALSE, smtp_active_hostname); -#ifndef DISABLE_TLS +#ifdef SERVERSIDE_CLOSE_NOWAIT +# ifndef DISABLE_TLS +tls_close(NULL, TLS_SHUTDOWN_NOWAIT); +# endif + +log_write(L_smtp_connection, LOG_MAIN, "%s closed by QUIT", + smtp_get_connection_info()); +#else + +# ifndef DISABLE_TLS tls_close(NULL, TLS_SHUTDOWN_WAIT); -#endif +# endif log_write(L_smtp_connection, LOG_MAIN, "%s closed by QUIT", smtp_get_connection_info()); @@ -3866,6 +3875,7 @@ The socket should become readble (though with no data) */ FD_SET(fd, &fds); (void) select(fd + 1, (SELECT_ARG2_TYPE *)&fds, NULL, NULL, &t_limit); } +#endif /*!DAEMON_CLOSE_NOWAIT*/ }