ChorusOne / fastsync

Send files between machines quickly by leveraging multiple TCP connections
Apache License 2.0
3 stars 0 forks source link

Add a version number to the wire protocol #4

Closed ruuda closed 1 month ago

ruuda commented 1 month ago

As brought up by @kucharskim, as a safety precaution, so we don’t connect sender version X to receiver version Y, the wire protocol should include something that identifies the version so we can exit if there is a mismatch. We don’t have to care about backwards compatibility, we can just fail on mismatch.

DavidVentura commented 1 month ago

~The easiest way to implement the wire protocol guard would be to add the protocol version on ChunkHeader, though that would add 1 byte of overhead every 262KiB (MAX_CHUNK_LEN), along with an extra branch per chunk.~ ~Is that OK? Alternatively, we could add a second type of message which is only transferred upon establishing each TCP connection~

I hadn't seen the TransferPlan/FilePlan :grimacing: