Gitweb:
https://git.exim.org/exim.git/commitdiff/8d7e00e408df4d92c37caabbfd68cdc75ebd2dfb
Commit: 8d7e00e408df4d92c37caabbfd68cdc75ebd2dfb
Parent: 2130e492c2cda886d74abbb77df4493f151e0a44
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Jan 23 23:15:58 2021 +0000
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Sun Jan 24 00:20:00 2021 +0000
TFO: cleanup the TCP pure ack of SMTP banner
---
src/src/smtp_out.c | 12 ++++++++++--
src/src/transports/smtp.c | 12 +++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c
index b1a25f7..2a392e5 100644
--- a/src/src/smtp_out.c
+++ b/src/src/smtp_out.c
@@ -349,14 +349,22 @@ else
save_errno = errno;
else if (early_data && !fastopen_blob && early_data->data && early_data->len)
{
+ /* We had some early-data to send, but couldn't do TFO */
HDEBUG(D_transport|D_acl|D_v)
debug_printf("sending %ld nonTFO early-data\n", (long)early_data->len);
+#ifdef TCP_QUICKACK_notdef
+ (void) setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, US &off, sizeof(off));
+#endif
if (send(sock, early_data->data, early_data->len, 0) < 0)
save_errno = errno;
}
-#ifdef TCP_QUICKACK
- (void) setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, US &off, sizeof(off));
+#ifdef TCP_QUICKACK_notdef
+ /* Under TFO (with openssl & pipe-conn; testcase 4069, as of
+ 5.10.8-100.fc32.x86_64) this seems to be inop.
+ Perhaps overwritten when we (client) go -> ESTABLISHED on seeing the 3rd-ACK?
+ For that case, added at smtp_reap_banner(). */
+ (void) setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, US &off, sizeof(off));
#endif
}
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 0a6bfde..30669d3 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -712,7 +712,17 @@ return count;
static BOOL
smtp_reap_banner(smtp_context * sx)
{
-BOOL good_response = smtp_read_response(sx, sx->buffer, sizeof(sx->buffer),
+BOOL good_response;
+#if defined(__linux__) && defined(TCP_QUICKACK)
+ { /* Hack to get QUICKACK disabled; has to be right after 3whs, and has to on->off */
+ int sock = sx->cctx.sock;
+ struct pollfd p = {.fd = sock, .events = POLLOUT};
+ int rc = poll(&p, 1, 1000);
+ (void) setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, US &on, sizeof(on));
+ (void) setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, US &off, sizeof(off));
+ }
+#endif
+good_response = smtp_read_response(sx, sx->buffer, sizeof(sx->buffer),
'2', (SOB sx->conn_args.ob)->command_timeout);
#ifdef EXPERIMENTAL_DSN_INFO
sx->smtp_greeting = string_copy(sx->buffer);