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. */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to