Enable use of sendfile
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 26 Apr 2017 14:28:22 +0000 (15:28 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 26 Apr 2017 19:27:10 +0000 (20:27 +0100)
doc/doc-txt/ChangeLog
src/OS/os.h-Linux
src/src/dkim_transport.c

index 1d6ad343bef471ab73f0cfc0435ff4573ffc1e50..4ea24a50c148047586b931a1083125b8ed1859fc 100644 (file)
@@ -61,6 +61,10 @@ JH/09 Avoid using a temporary file during transport using dkim.  Unless a
       creating the signature, and read the spool data file once for the
       signature and again for transmission.
 
       creating the signature, and read the spool data file once for the
       signature and again for transmission.
 
+JH/10 Enable use of sendfile in Linux builds as default.  It was disabled in
+      4.77 as the kernel support then wasn't solid, having issues in 64bit
+      mode.  Now, it's been long enough.
+
 
 Exim version 4.89
 -----------------
 
 Exim version 4.89
 -----------------
index cc1cef99be849c10d487aef94e5a767f02d95b38..3e9303cab8a28a36403b8b0a91c2b8529c87636c 100644 (file)
@@ -18,9 +18,10 @@ with the issue. */
 /* When using the DKIM, setting HAVE_LINUX_SENDFILE can increase
 performance on outgoing mail a bit. Note: With older glibc versions
 this setting will conflict with the _FILE_OFFSET_BITS=64 setting
 /* When using the DKIM, setting HAVE_LINUX_SENDFILE can increase
 performance on outgoing mail a bit. Note: With older glibc versions
 this setting will conflict with the _FILE_OFFSET_BITS=64 setting
-defined as part of the Linux CFLAGS. */
+defined as part of the Linux CFLAGS.  As of 2017 those are declared
+to be too old to build by default. */
 
 
-/* #define HAVE_LINUX_SENDFILE */
+#define HAVE_LINUX_SENDFILE
 
 #define F_FREESP     O_TRUNC
 typedef struct flock flock_t;
 
 #define F_FREESP     O_TRUNC
 typedef struct flock flock_t;
index 552e1beb17dc2377be89b74658cd4e295dba6582..2aba5605424bdc2262f988cad5898ff9f81533e9 100644 (file)
@@ -58,7 +58,7 @@ if (tls_out.active != out_fd)
   ssize_t copied = 0;
 
   while(copied >= 0 && off < size)
   ssize_t copied = 0;
 
   while(copied >= 0 && off < size)
-    copied = sendfile(tctx->u.fd, dkim_fd, &off, size - off);
+    copied = sendfile(out_fd, in_fd, &off, size - off);
   if (copied < 0)
     return FALSE;
   }
   if (copied < 0)
     return FALSE;
   }