summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-01-23 21:28:28 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2021-01-23 21:28:28 +0000
commit2130e492c2cda886d74abbb77df4493f151e0a44 (patch)
tree09860fcead05d0ff442daead41fb51ff61dc7456 /src
parent97cfe3942f67200f77f6ae9b302409075e4e5792 (diff)
Move QUICKACK disable as early as possible in server handling
Diffstat (limited to 'src')
-rw-r--r--src/src/daemon.c5
-rw-r--r--src/src/smtp_in.c9
2 files changed, 7 insertions, 7 deletions
diff --git a/src/src/daemon.c b/src/src/daemon.c
index 21807f64f..1006961d3 100644
--- a/src/src/daemon.c
+++ b/src/src/daemon.c
@@ -2431,6 +2431,11 @@ for (;;)
if (accept_socket >= 0)
{
+#ifdef TCP_QUICKACK /* Avoid pure-ACKs while in tls protocol pingpong phase */
+ /* Unfortunately we cannot be certain to do this before a TLS-on-connect
+ Client Hello arrives and is acked. We do it as early as possible. */
+ (void) setsockopt(accept_socket, IPPROTO_TCP, TCP_QUICKACK, US &off, sizeof(off));
+#endif
if (inetd_wait_timeout)
last_connection_time = time(NULL);
handle_smtp_call(listen_sockets, listen_socket_count, accept_socket,
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 4cc619014..0467b2257 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -2902,13 +2902,8 @@ if (check_proxy_protocol_host())
setup_proxy_protocol_host();
#endif
-#ifdef TCP_QUICKACK /* Avoid pure-ACKs while in tls protocol pingpong phase */
-(void) setsockopt(fileno(smtp_in), IPPROTO_TCP, TCP_QUICKACK,
- US &off, sizeof(off));
-#endif
-
- /* Start up TLS if tls_on_connect is set. This is for supporting the legacy
- smtps port for use with older style SSL MTAs. */
+/* Start up TLS if tls_on_connect is set. This is for supporting the legacy
+smtps port for use with older style SSL MTAs. */
#ifndef DISABLE_TLS
if (tls_in.on_connect)