X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/73a10da9bbc6aadd03c3aff7a12307252e617a71..5c161fa615ab4a2d40170fedd71d1b9a7f079ff6:/src/src/smtp_out.c diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c index 3dc3a13fb..911dd537e 100644 --- a/src/src/smtp_out.c +++ b/src/src/smtp_out.c @@ -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. */ /* A number of functions for driving outgoing SMTP calls. */ @@ -63,8 +64,8 @@ if (is_tainted(expint)) return FALSE; } -while (isspace(*expint)) expint++; -if (*expint == 0) return TRUE; +Uskip_whitespace(&expint); +if (!*expint) return TRUE; while ((iface = string_nextinlist(&expint, &sep, big_buffer, big_buffer_size))) @@ -155,11 +156,11 @@ return TRUE; static void tfo_out_check(int sock) { +# ifdef __FreeBSD__ struct tcp_info tinfo; int val; socklen_t len = sizeof(val); -# ifdef __FreeBSD__ /* The observability as of 12.1 is not useful as a client, only telling us that a TFO option was used on SYN. It could have been a TFO-R, or ignored by the server. */ @@ -177,6 +178,8 @@ switch (tcp_out_fastopen) # else /* Linux & Apple */ # if defined(TCP_INFO) && defined(EXIM_HAVE_TCPI_UNACKED) +struct tcp_info tinfo; +socklen_t len = sizeof(tinfo); switch (tcp_out_fastopen) { @@ -372,7 +375,7 @@ smtp_port_for_connect(host_item * host, int port) { if (host->port != PORT_NONE) { - HDEBUG(D_transport|D_acl|D_v) + HDEBUG(D_transport|D_acl|D_v) if (port != host->port) debug_printf_indent("Transport port=%d replaced by host-specific port=%d\n", port, host->port); port = host->port; @@ -498,7 +501,7 @@ else rc = n; } else - + { rc = send(outblock->cctx->sock, outblock->buffer, n, #ifdef MSG_MORE more ? MSG_MORE : 0 @@ -506,6 +509,17 @@ else 0 #endif ); + +#if defined(__linux__) + /* This is a workaround for a current linux kernel bug: as of + 5.6.8-200.fc31.x86_64 small (cctx->sock, IPPROTO_TCP, TCP_CORK, &off, sizeof(off)); +#endif + } } if (rc <= 0) @@ -595,7 +609,7 @@ if (format) while (!isspace(*p)) p++; while (isspace(*p)) p++; } - while (*p != 0) *p++ = '*'; + while (*p) *p++ = '*'; } HDEBUG(D_transport|D_acl|D_v) debug_printf_indent(" SMTP>> %s\n", big_buffer);