mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
b1b68ceedb
We have the invalid bit to indicate that a file isn't good. That's enough for remote devices. For ourselves, it would be good to know sometimes why the file isn't good - because it's an unsupported type, because it matches an ignore pattern, or because we detected the data is bad and we need to rescan it. Or, and this is the main future reason for the PR, because it's a change detected on a receive only device. We will want something like the invalid flag for those changes, but marking them as invalid today means the scanner will rehash them. Hence something more fine grained is required. This introduces a LocalFlags fields to the FileInfo where we can stash things that we care about locally. For example, FlagLocalUnsupported = 1 << 0 // The kind is unsupported, e.g. symlinks on Windows FlagLocalIgnored = 1 << 1 // Matches local ignore patterns FlagLocalMustRescan = 1 << 2 // Doesn't match content on disk, must be rechecked fully The LocalFlags fields isn't sent over the wire; instead the Invalid attribute is calculated based on the flags at index sending time. It's on the FileInfo anyway because that's what we serialize to database etc. The actual Invalid flag should after this just be considered when building the global state and figuring out availability for remote devices. It is not used for local file index entries. |
||
---|---|---|
.. | ||
testdata | ||
.gitignore | ||
.stfolder | ||
auditservice_test.go | ||
auditservice.go | ||
blockprof.go | ||
buildtag_noupgrade.go | ||
buildtag_race.go | ||
cpuusage_solaris.go | ||
cpuusage_unix.go | ||
cpuusage_windows.go | ||
cpuusage.go | ||
debug.go | ||
gui_auth.go | ||
gui_csrf.go | ||
gui_statics.go | ||
gui_test.go | ||
gui.go | ||
heapprof.go | ||
locations.go | ||
main_test.go | ||
main.go | ||
memsize_darwin.go | ||
memsize_linux.go | ||
memsize_netbsd.go | ||
memsize_solaris.go | ||
memsize_unimpl.go | ||
memsize_windows.go | ||
mocked_config_test.go | ||
mocked_connections_test.go | ||
mocked_cpuusage_test.go | ||
mocked_discovery_test.go | ||
mocked_events_test.go | ||
mocked_logger_test.go | ||
mocked_model_test.go | ||
monitor_test.go | ||
monitor.go | ||
openurl_unix.go | ||
openurl_windows.go | ||
perfstats_unix.go | ||
summaryservice.go | ||
superuser_unix.go | ||
superuser_windows.go | ||
traceback.go | ||
usage_report.go | ||
usage.go | ||
verboseservice.go |