diff options
| author | Maxim Konovalov <maxim@FreeBSD.org> | 2002-02-13 09:00:05 +0000 |
|---|---|---|
| committer | Maxim Konovalov <maxim@FreeBSD.org> | 2002-02-13 09:00:05 +0000 |
| commit | 492f1d9cbd6522d66ea9ed9038a42c23b98f4e3d (patch) | |
| tree | 6f8f18f3d098371ad67ee983e5f5535177cd0944 | |
| parent | e1178b3b9ddd237d4e68c42d302c22833ab863de (diff) | |
Notes
| -rw-r--r-- | libexec/ftpd/ftpd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 60b1bf984e66..6c71150d30c1 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1781,7 +1781,6 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg) { int c, filefd, netfd; char *buf; - size_t len; off_t cnt; transflag++; @@ -1824,17 +1823,16 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg) off_t offset; int err; - len = filesize; err = cnt = offset = 0; - while (err != -1 && cnt < filesize) { - err = sendfile(filefd, netfd, offset, len, + while (err != -1 && filesize > 0) { + err = sendfile(filefd, netfd, offset, 0, (struct sf_hdtr *) NULL, &cnt, 0); if (recvurg) goto got_oob; byte_count += cnt; offset += cnt; - len -= cnt; + filesize -= cnt; if (err == -1) { if (!cnt) |
