syncthing/lib/protocol
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
..
benchmark_test.go lib/model: Verify request content against weak (and possibly strong) hash (#4767) 2018-05-05 10:24:44 +02:00
bep_extensions.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
bep.pb.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
bep.proto Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
bufferpool.go build: Enable gometalinter "gosimple" check, improve build.go 2016-12-21 14:53:45 +01:00
common_test.go lib/model: Verify request content against weak (and possibly strong) hash (#4767) 2018-05-05 10:24:44 +02:00
compression_test.go Add 'lib/protocol/' from commit 'f91191218b192ace841c878f161832d19c09145a' 2015-09-22 19:34:29 +02:00
compression.go lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
conflict_test.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
counting.go Add 'lib/protocol/' from commit 'f91191218b192ace841c878f161832d19c09145a' 2015-09-22 19:34:29 +02:00
debug.go lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
deviceid_test.go lib/protocol: Optimize luhn and chunk functions 2017-09-03 10:26:12 +00:00
deviceid_test.pb.go all: Add invalid/ignored files to global list, announce to peers (fixes #623) 2017-11-11 19:18:17 +00:00
deviceid_test.proto lib/protocol: Use DeviceID in protocol messages, with custom marshalling 2016-10-29 21:56:24 +00:00
deviceid.go lib/protocol, vendor: Import luhn code directly 2017-09-20 21:34:32 +02:00
doc.go Add 'lib/protocol/' from commit 'f91191218b192ace841c878f161832d19c09145a' 2015-09-22 19:34:29 +02:00
errors.go lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
hello_test.go lib/protocol: Hello message length is an int16 2016-07-17 21:41:20 +00:00
hello_v0.13_xdr.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
hello_v0.13.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
hello.go build: Enable gometalinter "gosimple" check, improve build.go 2016-12-21 14:53:45 +01:00
LICENSE Add 'lib/protocol/' from commit 'f91191218b192ace841c878f161832d19c09145a' 2015-09-22 19:34:29 +02:00
luhn_test.go lib/protocol, vendor: Import luhn code directly 2017-09-20 21:34:32 +02:00
luhn.go lib/protocol: Add note about non-standard Luhn calculation (#4895) 2018-04-20 18:52:03 +02:00
nativemodel_darwin.go lib/model: Verify request content against weak (and possibly strong) hash (#4767) 2018-05-05 10:24:44 +02:00
nativemodel_unix.go lib/model, lib/protocol: Implement temporary indexes (fixes #950) 2016-04-15 10:59:41 +00:00
nativemodel_windows_test.go lib/protocol: Apply input filtering on file names 2016-12-01 12:35:32 +00:00
nativemodel_windows.go lib/model: Verify request content against weak (and possibly strong) hash (#4767) 2018-05-05 10:24:44 +02:00
protocol_test.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
protocol.go Add LocalFlags to FileInfo (#4952) 2018-06-24 09:50:18 +02:00
vector_test.go build, cmd, lib: Minimum supported compiler version is Go 1.5 2016-08-15 08:37:32 +02:00
vector.go lib: Handle metadata changes for send-only folders (fixes #4616, fixes #4627) (#4750) 2018-02-25 09:39:00 +01:00
wireformat.go lib/model: Verify request content against weak (and possibly strong) hash (#4767) 2018-05-05 10:24:44 +02:00