syncthing/lib/model
Jakob Borg d507126101 lib/protocol: Understand older/newer Hello messages (fixes #3287)
This is in preparation for future changes, but also improves the
handling when talking to pre-v0.13 clients. It breaks out the Hello
message and magic from the rest of the protocol implementation, with the
intention that this small part of the protocol will survive future
changes.

To enable this, and future testing, the new ExchangeHello function takes
an interface that can be implemented by future Hello versions and
returns a version indendent result type. It correctly detects pre-v0.13
protocols and returns a "too old" error message which gets logged to the
user at warning level:

   [I6KAH] 09:21:36 WARNING: Connecting to [...]:
     the remote device speaks an older version of the protocol (v0.12) not
     compatible with this version

Conversely, something entirely unknown will generate:

   [I6KAH] 09:40:27 WARNING: Connecting to [...]:
     the remote device speaks an unknown (newer?) version of the protocol

The intention is that in future iterations the Hello exchange will
succeed on at least one side and ExchangeHello will return the actual
data from the Hello together with ErrTooOld and an even more precise
message can be generated.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3289
2016-06-09 10:50:14 +00:00
..
testdata mv internal lib 2015-08-09 09:35:26 +02:00
.gitignore mv internal lib 2015-08-09 09:35:26 +02:00
debug.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
deviceactivity_test.go lib/model, lib/protocol: Implement temporary indexes (fixes #950) 2016-04-15 10:59:41 +00:00
deviceactivity.go lib/model, lib/protocol: Implement temporary indexes (fixes #950) 2016-04-15 10:59:41 +00:00
devicedownloadstate_test.go lib/model: Test should pass go vet inspections 2016-04-15 11:41:18 +00:00
devicedownloadstate.go lib/model: Don't deadlock when returning temp index block counts 2016-05-26 09:16:08 +00:00
doc.go mv internal lib 2015-08-09 09:35:26 +02:00
folder.go lib/model: Refactor out folder and folderscan types, simplify somewhat 2016-04-26 14:01:46 +00:00
folderscan.go lib/model: Refactor out folder and folderscan types, simplify somewhat 2016-04-26 14:01:46 +00:00
folderstate.go lib/model: Refactor out folder and folderscan types, simplify somewhat 2016-04-26 14:01:46 +00:00
model_test.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
model.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
progressemitter_test.go lib/model: Track puller creation times (fixes #3145) 2016-05-22 10:16:09 +00:00
progressemitter.go all: Clean up dead code 2016-04-22 21:15:36 +00:00
queue_test.go tests: messagediff argument order should be expected, actual 2016-03-17 08:03:29 +01:00
queue.go Tests must use locking to avoid race (fixes #2394) 2015-10-20 08:51:31 +02:00
rofolder.go lib/model: Use factories for creating folders 2016-05-04 10:47:33 +00:00
rwfolder_test.go lib/model: Emit LocalDiskUpdated events on detecting local changes 2016-05-19 00:19:26 +00:00
rwfolder.go lib/model: Make the (?d) prefix actually work 2016-05-28 04:17:34 +00:00
sentdownloadstate.go lib/model: Track puller creation times (fixes #3145) 2016-05-22 10:16:09 +00:00
sharedpullerstate_test.go lib/model, lib/protocol: Implement temporary indexes (fixes #950) 2016-04-15 10:59:41 +00:00
sharedpullerstate.go lib/model: Track puller creation times (fixes #3145) 2016-05-22 10:16:09 +00:00
tempname_test.go mv internal lib 2015-08-09 09:35:26 +02:00
tempname.go mv internal lib 2015-08-09 09:35:26 +02:00
util.go mv internal lib 2015-08-09 09:35:26 +02:00