summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2020-12-14 22:13:58 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2020-12-14 22:13:58 +0000
commit3696db923f8e182e508b01bd46c0ba255c621dd6 (patch)
tree0790c47c5c4e3bf77f9bc1735451f17fb6a96240 /libexec
parentcad703dc09795d84f980ff6349a1a2e8816bbbd6 (diff)
downloadsrc-test-3696db923f8e182e508b01bd46c0ba255c621dd6.tar.gz
src-test-3696db923f8e182e508b01bd46c0ba255c621dd6.zip
Improve the counting of blocks used to transfer a file from the
server to the client in case of not using an OACK: Don't miss the first block in case of it is not also the last one. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=368647
Diffstat (limited to 'libexec')
-rw-r--r--libexec/tftpd/tftp-transfer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c
index 1f130b498e2ee..2f3dc3fe05600 100644
--- a/libexec/tftpd/tftp-transfer.c
+++ b/libexec/tftpd/tftp-transfer.c
@@ -258,6 +258,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts,
if (firstblock != NULL) {
writesize = write_file(firstblock->th_data, fb_size);
ts->amount += writesize;
+ ts->blocks++;
windowblock++;
if (windowsize == 1 || fb_size != segsize) {
for (i = 0; ; i++) {
@@ -280,7 +281,6 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts,
}
if (fb_size != segsize) {
- ts->blocks++;
write_close();
gettimeofday(&(ts->tstop), NULL);
return;