summaryrefslogtreecommitdiff
path: root/usr.bin/tftp
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2018-03-09 23:25:18 +0000
committerAlan Somers <asomers@FreeBSD.org>2018-03-09 23:25:18 +0000
commitd3953c1f478f7933f905cfb85ef8ea7a08133e19 (patch)
treebc94d3145a8bfe3fa1fcc2ea9538d40f9da26b12 /usr.bin/tftp
parentc60fdff77d035caa09ae2dcebe6be7d1deb1da54 (diff)
downloadsrc-test2-d3953c1f478f7933f905cfb85ef8ea7a08133e19.tar.gz
src-test2-d3953c1f478f7933f905cfb85ef8ea7a08133e19.zip
tftpd: Flush files as soon as they are fully received
On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file. Instead, it waits five seconds just in case the client didn't receive the server's last ACK and decides to resend the final DATA packet. Unfortunately, this created a 5 second delay from when the client thinks it's done sending the file, and when the file is available for other processes. Fix this bug by closing the file as soon as receipt is finished. PR: 157700 Reported by: Barry Mishler <barry_mishler@yahoo.com> MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=330710
Diffstat (limited to 'usr.bin/tftp')
-rw-r--r--usr.bin/tftp/tftp.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index 2b4c7a4b5f3f..9cc37073d954 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -265,7 +265,6 @@ recvfile(int peer, char *port, int fd, char *name, char *mode)
tftp_receive(peer, &block, &tftp_stats, rp, n);
}
- write_close();
if (tftp_stats.amount > 0)
printstats("Received", verbose, &tftp_stats);
return;