Compare the hash of files with identical mtime/size #5589
authorChristian Kamm <mail@ckamm.de>
Wed, 14 Jun 2017 10:14:46 +0000 (12:14 +0200)
committerChristian Kamm <mail@ckamm.de>
Thu, 15 Jun 2017 11:54:16 +0000 (13:54 +0200)
commit816096311027bac0f391ea97d0b61b4175e9b8f9
tree7ad93c6ac77711d82ff2453366bf3144385ed94f
parentd50d8b86cf135dff833679b073406e4bdd6deae6
Compare the hash of files with identical mtime/size #5589

* For conflicts where mtime and size are identical:

  a) If there's no remote checksum, skip (unchanged)
  b) If there's a remote checksum that's a useful hash, create a
     PropagateDownload job and compute the local hash. If the hashes
     are identical, don't download the file and just update metadata.

* Avoid exposing the existence of checksumTypeId beyond the database
  layer. This makes handling checksums easier in general because they
  can usually be treated as a single blob.

  This change was prompted by the difficulty of producing file_stat_t
  entries uniformly from PROPFINDs and the database.
25 files changed:
csync/src/csync.c
csync/src/csync.h
csync/src/csync_private.h
csync/src/csync_reconcile.c
csync/src/csync_statedb.c
csync/src/csync_update.c
csync/src/vio/csync_vio_file_stat.c
src/libsync/checksums.cpp
src/libsync/checksums.h
src/libsync/discoveryphase.cpp
src/libsync/propagatedownload.cpp
src/libsync/propagatedownload.h
src/libsync/propagateremotemove.cpp
src/libsync/propagateupload.cpp
src/libsync/propagateupload.h
src/libsync/propagateuploadng.cpp
src/libsync/propagateuploadv1.cpp
src/libsync/propagatorjobs.cpp
src/libsync/syncengine.cpp
src/libsync/syncfileitem.h
src/libsync/syncjournaldb.cpp
src/libsync/syncjournalfilerecord.cpp
src/libsync/syncjournalfilerecord.h
test/testsyncengine.cpp
test/testsyncjournaldb.cpp