summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-10-15 09:51:36 +0000
committeryar <yar@FreeBSD.org>2004-10-15 09:51:36 +0000
commit6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f (patch)
tree73d925f3bb3234ecf8796d12c68237b139e2fd5b /libexec/ftpd/ftpd.c
parente6e865ec71476755892cc14cfe35809ae34f8e47 (diff)
downloadFreeBSD-src-6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f.zip
FreeBSD-src-6cff4ecf574f0b18400f7d8ff13d8bd7a0dd352f.tar.gz
We must not fall back to the old way (read-write)
if sendfile() transferred some data before throwing a error condition because sendfile() won't move the file offset for read() to start from. MFC after: 2 weeks
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 271bd2f..e8e25b4 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -2058,7 +2058,7 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg)
filesize -= cnt;
if (err == -1) {
- if (!cnt)
+ if (cnt == 0 && offset == 0)
goto oldway;
goto data_err;
OpenPOWER on IntegriCloud