Use single TCP segment for SMTP, TLS and TCP closes.
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 29 Dec 2018 19:27:20 +0000 (19:27 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 10 Feb 2019 23:22:50 +0000 (23:22 +0000)
(cherry picked from commit a7846940c876fd2a76b89240aa83e7083ae9650a)

src/src/smtp_in.c
src/src/transports/smtp.c

index a238ae261dc3f1f077ebfb079601c6fbe9a0a5ef..b071298c73d6e79f5601a9b641f7db32caa5b6c7 100644 (file)
@@ -3822,6 +3822,11 @@ if (acl_smtp_quit)
     log_write(0, LOG_MAIN|LOG_PANIC, "ACL for QUIT returned ERROR: %s",
       *log_msgp);
   }
+
+#ifdef TCP_CORK
+(void) setsockopt(fileno(smtp_out), IPPROTO_TCP, TCP_CORK, US &on, sizeof(on));
+#endif
+
 if (*user_msgp)
   smtp_respond(US"221", 3, TRUE, *user_msgp);
 else
index 98ab002821f4dacd90a163803bf9fa3debb73588..c1cba598c5db5ea9fede20a98edc7903dfa76259 100644 (file)
@@ -4330,6 +4330,9 @@ This change is being made on 31-Jul-98. After over a year of trouble-free
 operation, the old commented-out code was removed on 17-Sep-99. */
 
 SEND_QUIT:
+#ifdef TCP_CORK
+(void) setsockopt(sx.cctx.sock, IPPROTO_TCP, TCP_CORK, US &on, sizeof(on));
+#endif
 if (sx.send_quit) (void)smtp_write_command(&sx, SCMD_FLUSH, "QUIT\r\n");
 
 END_OFF: