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
This commit is contained in:
Michael Tuexen 2020-12-14 22:13:58 +00:00
parent cad703dc09
commit 3696db923f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368647

View File

@ -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;