From 133fad90b5f9cef26f9c78cc5b302358c9c4da6a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 31 Oct 2007 14:01:35 -0700 Subject: Make explicit draining the socket on RECVFILE. Add capability for large UNIX write if not signing and recvfile set. Cope with large UNIX write length on incoming processing. Stevef - we can now test 1-16Mb writes from CIFFS. Jeremy. (This used to be commit 8cf78776b0a44bd026cef3d74eb11cfb415f8303) --- source3/lib/recvfile.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c index a009ce9dd6..f9788fdefb 100644 --- a/source3/lib/recvfile.c +++ b/source3/lib/recvfile.c @@ -126,20 +126,6 @@ static ssize_t default_sys_recvfile(int fromfd, #if defined(HAVE_SPLICE_SYSCALL) -#ifdef JRA_SPLICE_TEST -#include -#include - -#define __NR_splice 313 -_syscall6( long, splice, - int, fromfd, - loff_t *, fromoffset, - int, tofd, - loff_t *, tooffset, - size_t, count, - unsigned int, flags); -#endif - /* * Try and use the Linux system call to do this. * Remember we only return -1 if the socket read @@ -168,6 +154,13 @@ ssize_t sys_recvfile(int fromfd, 0); if (ret == -1) { if (errno != EINTR) { + if (total_written == 0 && + errno == EBADF || errno == EINVAL) { + return default_sys_recvfile(fromfd, + tofd, + offset, + count); + } break; } continue; -- cgit