Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2020 22:13:59 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368647 - head/libexec/tftpd
Message-ID:  <202012142213.0BEMDxjJ061624@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Mon Dec 14 22:13:58 2020
New Revision: 368647
URL: https://svnweb.freebsd.org/changeset/base/368647

Log:
  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

Modified:
  head/libexec/tftpd/tftp-transfer.c

Modified: head/libexec/tftpd/tftp-transfer.c
==============================================================================
--- head/libexec/tftpd/tftp-transfer.c	Mon Dec 14 22:07:07 2020	(r368646)
+++ head/libexec/tftpd/tftp-transfer.c	Mon Dec 14 22:13:58 2020	(r368647)
@@ -258,6 +258,7 @@ tftp_receive(int peer, uint16_t *block, struct tftp_st
 	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_st
 		}
 
 		if (fb_size != segsize) {
-			ts->blocks++;
 			write_close();
 			gettimeofday(&(ts->tstop), NULL);
 			return;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012142213.0BEMDxjJ061624>