]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tftpd: Flush files as soon as they are fully received
authorasomers <asomers@FreeBSD.org>
Fri, 9 Mar 2018 23:25:18 +0000 (23:25 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 9 Mar 2018 23:25:18 +0000 (23:25 +0000)
commitccec95ca4c6c70b2113eb2463951490a7e2f6af9
treebc94d3145a8bfe3fa1fcc2ea9538d40f9da26b12
parent1c3355767e0b01e78db3d559bcf22acd68f1aa8c
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
libexec/tftpd/tests/functional.c
libexec/tftpd/tftp-transfer.c
libexec/tftpd/tftpd.c
usr.bin/tftp/tftp.c