syncthing/cmd/syncthing
Jakob Borg b1b68ceedb
Add LocalFlags to FileInfo (#4952)
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.
2018-06-24 09:50:18 +02:00
..
testdata Fix STGUIASSETS search paths & order (fixes #2827) 2016-03-12 12:17:25 +00:00
.gitignore Repair model tests 2014-03-30 21:59:40 +02:00
.stfolder Merge remote-tracking branch 'syncthing/pr/1577' 2015-04-06 20:53:32 +02:00
auditservice_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
auditservice.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
blockprof.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
buildtag_noupgrade.go cmd/syncthing: Append build tags used to the long version string 2017-03-16 23:40:27 +00:00
buildtag_race.go cmd/syncthing: Append build tags used to the long version string 2017-03-16 23:40:27 +00:00
cpuusage_solaris.go cmd/syncthing: Use a 10 second EWMA for CPU usage, refactor a little 2017-04-20 08:33:09 +00:00
cpuusage_unix.go cmd/syncthing: Use a 10 second EWMA for CPU usage, refactor a little 2017-04-20 08:33:09 +00:00
cpuusage_windows.go cmd/syncthing: Process handle should be closed 2017-05-14 18:06:27 +02:00
cpuusage.go cmd/syncthing: Start CPU usage monitoring not from init (fixes #4183) 2017-05-31 18:14:04 +00:00
debug.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
gui_auth.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
gui_csrf.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
gui_statics.go cmd/syncthing: Correctly compare If-Modified-Since in HTTP server (#5016) 2018-06-18 08:14:17 +02:00
gui_test.go cmd/syncthing: Improve local host check (fixes #4815) (#4816) 2018-03-15 11:29:52 +01:00
gui.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
heapprof.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
locations.go all: Convert folders to use filesystem abstraction 2017-08-19 14:36:56 +00:00
main_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
main.go lib/db: Move database schema migration into its own file (#4985) 2018-06-08 12:46:00 +02:00
memsize_darwin.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
memsize_linux.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
memsize_netbsd.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
memsize_solaris.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
memsize_unimpl.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
memsize_windows.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
mocked_config_test.go gui, lib/config, lib/model: Support auto-accepting folders (fixes #2299) 2017-12-07 07:08:24 +00:00
mocked_connections_test.go cmd/syncthing: Add more stats to usage reports (ref #3628) 2017-10-12 06:16:46 +00:00
mocked_cpuusage_test.go cmd/syncthing: Start CPU usage monitoring not from init (fixes #4183) 2017-05-31 18:14:04 +00:00
mocked_discovery_test.go lib/connections: Fix local address priority 2017-11-22 07:05:49 +00:00
mocked_events_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
mocked_logger_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
mocked_model_test.go all: Implement variable sized blocks (fixes #4807) 2018-04-16 19:08:50 +01:00
monitor_test.go cmd/syncthing: Add test for truncate behavior of log file (ref #4255) 2017-09-02 06:56:35 +00:00
monitor.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
openurl_unix.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
openurl_windows.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
perfstats_unix.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
summaryservice.go all: Fix FS watcher restarting and web UI indication (fixes #4923) (#4962) 2018-06-11 15:47:54 +02:00
superuser_unix.go cmd/syncthing: Warn when running as a super user (fixes #4123) 2017-05-15 05:42:21 +00:00
superuser_windows.go cmd/syncthing: Warn when running as a super user (fixes #4123) 2017-05-15 05:42:21 +00:00
traceback.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
usage_report.go all: Serialize folder types to new names (#4942) 2018-05-13 09:58:00 +02:00
usage.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
verboseservice.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00