summaryrefslogtreecommitdiffstats
path: root/source3/lib/recvfile.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Split out sys_[read|write] & friendsVolker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Remove a few #ifdef EWOULDBLOCkVolker Lendecke2014-09-181-8/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* s3:smbd: let default_sys_recvfile() and sys_recvfile() cope with ↵Jeremy Allison2014-05-241-2/+44
| | | | | | | | | | | | | | | | | non-blocking sockets. default_sys_recvfile() and splice() recvfile were not written to cope with non-blocking sockets. When either the socket read() or splice() return -1 with errno EWOULDBLOCK or EAGAIN, if no bytes have been processed yet, return -1 and let the caller set blocking and retry. If bytes have been processed, just return them as a short read and let the caller retry with the remaining needed reads. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:lib: use stack buffers in drain_socket() and default_sys_recvfile()Stefan Metzmacher2014-04-111-16/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Ensure drain_socket() operates on a blocking socket.Jeremy Allison2013-04-191-2/+15
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-4/+4
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* build: Remove sys_lseek wrapperAndrew Bartlett2012-04-051-1/+1
|
* Third part of fix for bug #8679 - recvfile code path using splice() on Linux ↵Jeremy Allison2011-12-301-21/+18
| | | | | | | | leaves data in the pipe on short write. Fix default_sys_recvfile() to correctly cope with short writes. Return the amount written. Return -1 and set errno if no data could be written.
* Second part of fix for bug #8679 - recvfile code path using splice() on ↵Jeremy Allison2011-12-301-1/+30
| | | | | | | Linux leaves data in the pipe on short write. Split out the functionality of drain_socket() into a separate function from default_sys_recvfile().
* Fix bug #8679 - recvfile code path using splice() on Linux leaves data in ↵Jeremy Allison2011-12-251-3/+2
| | | | | | | | | the pipe on short write Bug found and fix suggested by Andrew Bartlett. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sun Dec 25 07:46:38 CET 2011 on sn-devel-104
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* Several fixes to our use of spliceVolker Lendecke2009-01-071-4/+6
| | | | | | | | | | | | | | | | | The splice manpage explicitly requires loff_t as offset. Copy "offset" there. Probably not required, but I wanted to make sure it's as required. Splice blocks with large buffers. For me it worked with 16k and blocked with 32k and beyond. It would be nice to see a clarification in the manpage of splice for this behaviour. Splice if used with an offset increments the offset. From the manpage this was at least not entirely obvious :-) I haven't yet activated this (try_splice_call ist still false by default), it needs more testing. Volker
* Disable the use of splice(2)Volker Lendecke2008-12-311-1/+1
| | | | | | | | | | On a debian lenny installation with a kernel that calls itself 2.6.28, I could repeatably block smbd using splice. According to the output of netstat, the recvq of the TCP connection was full and at the same time according to strace smbd was stuck in a splice syscall trying to read from that TCP connection. We can not protect ourselves from this condition, as nobody will ever notify us that something is broken. So sadly we can't use splice yet at all. Maybe in 2.6.29...
* Try to fix recvfile using splice on LinuxVolker Lendecke2008-12-311-21/+36
| | | | | | | | According to the splice(2) manpage, one of the file descriptors *must* be a pipe. With this patch I could successfully run splice(2) on a debian lenny installation. Jeremy, please check!
* Fix bug #5477 - recvfile code was broken.Jeremy Allison2008-05-201-0/+10
| | | | | Jeremy. (This used to be commit 830337f054a6c0646d85df33d9958e99283e727a)
* Enable tests for splice on Linux. Add a static (vl, I hate this)Jeremy Allison2008-05-061-2/+19
| | | | | | | so we can detect broken Linux recvfile splice and correctly fall back. Jeremy. (This used to be commit ec2d301a7aac173aba41dd2074037f27d05095ce)
* Make explicit draining the socket on RECVFILE. AddJeremy Allison2007-10-311-14/+7
| | | | | | | | | 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)
* Handle the disk full error case correctly.Jeremy Allison2007-10-301-6/+25
| | | | | Jeremy. (This used to be commit b7088bb9c2a00d4717b9a7efa4bddc0c005f4efb)
* Add new parameter, "min receivefile size" (by default setJeremy Allison2007-10-301-2/+38
| | | | | | | | | | to zero). If non-zero, writeX calls greater than this value will be left in the socket buffer for later handling with recvfile (or userspace equivalent). Definition of recvfile for your system is left as an exercise for the reader (I'm working on getting splice working :-). Jeremy. (This used to be commit 11c03b75ddbcb6e36b231bb40a1773d1c550621c)
* Forgot to add recvfile.cJeremy Allison2007-10-291-0/+158
Jeremy. (This used to be commit d5886218e53910b7015e6f13bc634e1bf338565a)