1
mirror of https://github.com/rclone/rclone synced 2024-11-29 07:55:12 +01:00
rclone/backend/hasher
nielash 9b650d3517 hasher: look for cached hash if passed hash unexpectedly blank
Before this change, Hasher did not check whether a "passed hash" (hashtype
natively supported by the wrapped backend) returned from a backend was blank,
and would sometimes return a blank hash to the caller even when a non-blank hash
was already stored in the db. This caused issues with, for example, Google
Drive, which has SHA1 / SHA256 hashes for some files but not others
(https://rclone.org/drive/#sha1-or-sha256-hashes-may-be-missing) and sometimes also
does not have hashes for very recently modified files.

After this change, Hasher will check if the received "passed hash" is
unexpectedly blank, and if so, it will continue to try other enabled methods,
such as retrieving a value from the database, or possibly regenerating it.

https://forum.rclone.org/t/hasher-with-gdrive-backend-does-not-return-sha1-sha256-for-old-files/44680/9?u=nielash
2024-03-09 11:58:02 +00:00
..
commands.go hasher: fix invalid memory address error when MaxAge == 0 2024-01-02 18:14:01 +00:00
hasher_internal_test.go hasher: fix invalid memory address error when MaxAge == 0 2024-01-02 18:14:01 +00:00
hasher_test.go hasher: fix invalid memory address error when MaxAge == 0 2024-01-02 18:14:01 +00:00
hasher.go hasher: fix error from trying to stop an already-stopped db 2024-03-09 11:58:02 +00:00
kv.go hashsum: support creating hash from data received on stdin 2021-11-11 15:16:45 +01:00
object.go hasher: look for cached hash if passed hash unexpectedly blank 2024-03-09 11:58:02 +00:00