From: Jeremy Harris Date: Fri, 1 Jan 2021 14:43:04 +0000 (+0000) Subject: FreeBSD: packet coalescing X-Git-Tag: exim-4.95-RC0~167 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/6454662ecb9e407c0616f0464c3e1f69829d14cf FreeBSD: packet coalescing --- diff --git a/src/src/exim.h b/src/src/exim.h index f27ed5cd8..bb8e4f6e2 100644 --- a/src/src/exim.h +++ b/src/src/exim.h @@ -606,5 +606,13 @@ default to EDQUOT if it exists, otherwise ENOSPC. */ # define EXIM_GROUPLIST_SIZE NGROUPS_MAX #endif +/* Linux has TCP_CORK, FreeBSD has TCP_NOPUSH; they do pretty much the same */ + +#ifdef TCP_CORK +# define EXIM_TCP_CORK TCP_CORK +#elif defined(TCP_NOPUSH) +# define EXIM_TCP_CORK TCP_NOPUSH +#endif + #endif /* End of exim.h */ diff --git a/src/src/malware.c b/src/src/malware.c index a42e39a57..b581a8752 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -132,12 +132,6 @@ static const uschar * malware_regex_default = US ".+"; static const pcre * malware_default_re = NULL; -#ifdef TCP_CORK -# define EXIM_TCP_CORK TCP_CORK -#elif defined(TCP_NOPUSH) -# define EXIM_TCP_CORK TCP_NOPUSH -#endif - #ifndef DISABLE_MAL_CLAM /* The maximum number of clamd servers that are supported in the configuration */ # define MAX_CLAMD_SERVERS 32 diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 29f656834..13cba2ec2 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -3819,8 +3819,8 @@ 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)); +#ifdef EXIM_TCP_CORK +(void) setsockopt(fileno(smtp_out), IPPROTO_TCP, EXIM_TCP_CORK, US &on, sizeof(on)); #endif if (*user_msgp) diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index a8ae606d1..8f42871bf 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -4393,8 +4393,8 @@ 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)); +#ifdef EXIM_TCP_CORK +(void) setsockopt(sx->cctx.sock, IPPROTO_TCP, EXIM_TCP_CORK, US &on, sizeof(on)); #endif if (sx->send_quit) (void)smtp_write_command(sx, SCMD_FLUSH, "QUIT\r\n");