[exim-cvs] Move QUICKACK disable as early as possible in ser…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Move QUICKACK disable as early as possible in server handling
Gitweb: https://git.exim.org/exim.git/commitdiff/2130e492c2cda886d74abbb77df4493f151e0a44
Commit:     2130e492c2cda886d74abbb77df4493f151e0a44
Parent:     97cfe3942f67200f77f6ae9b302409075e4e5792
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Jan 23 21:28:28 2021 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sat Jan 23 21:28:28 2021 +0000


    Move QUICKACK disable as early as possible in server handling
---
 src/src/daemon.c  | 5 +++++
 src/src/smtp_in.c | 9 ++-------
 2 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/src/src/daemon.c b/src/src/daemon.c
index 21807f6..1006961 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 4cc6190..0467b22 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)