svn commit: r368657 - head/libexec/tftpd

Michael Tuexen <[email protected]> Tue, 15 Dec 2020 09:43:19 +0000 (UTC)
Newsgroups gmane.os.freebsd.devel.cvs
Message-ID <202012150943.0BF9hJCx094573__4860.93698288954$1608025405$gmane$org@repo.freebsd.org>
Author: tuexen
Date: Tue Dec 15 09:43:18 2020
New Revision: 368657
URL: https://svnweb.freebsd.org/changeset/base/368657

Log:
  When receiving a file having a length, which is a mulitple of the blocksize,
  close the file once it is received.
  
  Reported by:	Timo Voelker
  MFC after:	1 week

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

Modified: head/libexec/tftpd/tftp-transfer.c
==============================================================================
--- head/libexec/tftpd/tftp-transfer.c	Tue Dec 15 08:29:45 2020	(r368656)
+++ head/libexec/tftpd/tftp-transfer.c	Tue Dec 15 09:43:18 2020	(r368657)
@@ -397,9 +397,9 @@ tftp_receive(int peer, uint16_t *block, struct tftp_st
 					send_error(peer, ENOSPACE);
 				goto abort;
 			}
-			if (n_data != segsize)
-				write_close();
 		}
+		if (n_data != segsize)
+			write_close();
 		windowblock++;
 
 		/* Only send ACKs for the last block in the window. */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"