X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d315eda12f25ca2f72ca56b777a427c9ee7188e1..925ac8e4f1c5d365ddea2f7aee460cd0a3cd409d:/src/src/dkim_transport.c?ds=sidebyside diff --git a/src/src/dkim_transport.c b/src/src/dkim_transport.c index a654c2516..4d26f9291 100644 --- a/src/src/dkim_transport.c +++ b/src/src/dkim_transport.c @@ -12,10 +12,6 @@ #ifndef DISABLE_DKIM /* rest of file */ -#ifdef HAVE_LINUX_SENDFILE -# include -#endif - static BOOL dkt_sign_fail(struct ob_dkim * dkim, int * errp) @@ -43,11 +39,11 @@ return TRUE; static BOOL dkt_send_file(int out_fd, int in_fd, off_t off, size_t size) { -DEBUG(D_transport) debug_printf("send file fd=%d size=%l\n", out_fd, size - off); +DEBUG(D_transport) debug_printf("send file fd=%d size=%u\n", out_fd, (unsigned)(size - off)); /*XXX should implement timeout, like transport_write_block_fd() ? */ -#ifdef HAVE_LINUX_SENDFILE +#ifdef OS_SENDFILE /* We can use sendfile() to shove the file contents to the socket. However only if we don't use TLS, as then there's another layer of indirection @@ -57,7 +53,7 @@ if (tls_out.active != out_fd) ssize_t copied = 0; while(copied >= 0 && off < size) - copied = sendfile(out_fd, in_fd, &off, size - off); + copied = os_sendfile(out_fd, in_fd, &off, size - off); if (copied < 0) return FALSE; } @@ -81,7 +77,7 @@ else { #ifdef SUPPORT_TLS wwritten = tls_out.active == out_fd - ? tls_write(FALSE, p, sread) + ? tls_write(FALSE, p, sread, FALSE) : write(out_fd, CS p, sread); #else wwritten = write(out_fd, CS p, sread); @@ -204,7 +200,7 @@ int dkim_fd; int save_errno = 0; BOOL rc; uschar * dkim_spool_name, * dkim_signature; -int sread = 0, wwritten = 0, siglen, options; +int sread = 0, wwritten = 0, siglen = 0, options; off_t k_file_size; const uschar * errstr; @@ -255,7 +251,7 @@ else if (!(rc = dkt_sign_fail(dkim, &save_errno))) goto CLEANUP; } -#ifndef HAVE_LINUX_SENDFILE +#ifndef OS_SENDFILE if (options & topt_use_bdat) #endif if ((k_file_size = lseek(dkim_fd, 0, SEEK_END)) < 0)