widelands / wl_addons_server

Provides the add-ons server and all add-ons for the Widelands game.

Home Page:https://www.widelands.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updating add-on should not transfer unchanged files

Noordfrees opened this issue · comments

https://www.widelands.org/forum/post/38363/

When updating an existing add-on, send only files that have actually changed.

I guess diffing files locally might be complicated since the "original" might not be around, but we can use checksums.
The protocol would then look like this:

  • Client sends CMD_SUBMIT with full list of dirs, filenames, and checksums.
  • Server sends list of files which need to be replaced:
    • Transfer all files that are not present on the server yet or whose checksum has changed.
    • If a new file has the same checksum as an existing file, we can assume that the file was moved or copied, so we don't need to request it.
    • If multiple files have the same checksum, only one copy needs to be sent.
  • Client sends the files requested by the server.
  • Server copies unchanged files over into the uploaded directory.