summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2002-07-01 14:29:44 +0000
committermaxim <maxim@FreeBSD.org>2002-07-01 14:29:44 +0000
commit53025a95ff19c99a706b837be94878f4cf52cff5 (patch)
tree0ffa694f4be7a4902369f57c5b804f5f827875a4 /libexec/ftpd
parent20e451e8dc81259aed016ba86f53495037c820cd (diff)
downloadFreeBSD-src-53025a95ff19c99a706b837be94878f4cf52cff5.zip
FreeBSD-src-53025a95ff19c99a706b837be94878f4cf52cff5.tar.gz
Move 'byte_count' calculation just before 'recvurg' check. It is a global
variable and used in myoob(). PR: bin/38928 Submitted by: Oliver Fromme <olli@secnetix.de> MFC after: 1 month
Diffstat (limited to 'libexec/ftpd')
-rw-r--r--libexec/ftpd/ftpd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 2ae2d6d..769e220 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1832,9 +1832,13 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg)
while (err != -1 && filesize > 0) {
err = sendfile(filefd, netfd, offset, 0,
(struct sf_hdtr *) NULL, &cnt, 0);
+ /*
+ * Calculate byte_count before OOB processing.
+ * It can be used in myoob() later.
+ */
+ byte_count += cnt;
if (recvurg)
goto got_oob;
- byte_count += cnt;
offset += cnt;
filesize -= cnt;
OpenPOWER on IntegriCloud