Callisto82 / tftp.net

Implements the TFTP (Trivial File Transfer) protocol (client/server) in an easy-to-use C#/.NET library.
Microsoft Public License
81 stars 38 forks source link

Data Packet Block Number 0 Occurs on Large Data Files #6

Closed hiowaguy closed 5 years ago

hiowaguy commented 5 years ago

Sending a large data file (hundreds of megabytes) results in the transfer eventually reaching data packet with block number 65535. The next data packet should be sent with block number 1 per the TFTP specification, but instead block number 0 is sent which may be rejected by the peer.

Callisto82 commented 5 years ago

Hi there! Thanks for your input. I checked some discussions surrounding that topic. There does not seem to be a general agreement on whether a) wrap-around should be allowed in the first place b) wrap-around should be to zero or one.

This discussion seems to summarize is nicely: https://www.compuphase.com/tftp.htm. It seems we should make that behavior customizable. I will try to look into it.

Callisto82 commented 5 years ago

As written before, wrapping arround to zero and wrapping to one should be supported.

I enhanced the library and you can now configure the behaviour using the ITftpTransfer.BlockCounterWrapping property.