summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-31 14:01:35 -0700
committerJeremy Allison <jra@samba.org>2007-10-31 14:01:35 -0700
commit133fad90b5f9cef26f9c78cc5b302358c9c4da6a (patch)
tree62e16ef71d5bb2640a6f0ec87349f2b16145a5a8 /source3/lib
parentff82c0a037b7c7ce69d87ab70284acc71df5e1a7 (diff)
downloadsamba-133fad90b5f9cef26f9c78cc5b302358c9c4da6a.tar.gz
samba-133fad90b5f9cef26f9c78cc5b302358c9c4da6a.tar.bz2
samba-133fad90b5f9cef26f9c78cc5b302358c9c4da6a.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/recvfile.c21
1 files changed, 7 insertions, 14 deletions
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 <linux/unistd.h>
-#include <sys/syscall.h>
-
-#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;