syncthing/lib
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
..
auto build: Generate gui.files.go on the fly, remove from repo 2016-03-28 10:03:13 +00:00
beacon Remove unused struct field 2015-10-27 09:55:05 +01:00
config lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
connections lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
db lib/db,cmd/stindex: Expose VersionList and use it in stindex 2016-05-31 19:29:26 +00:00
dialer lib/connections: Handle wrapped connection in SetTCPOptions (fixes #3223) 2016-05-31 08:11:57 +00:00
discover all: Correct spelling in comments 2016-05-08 10:54:22 +00:00
events cmd/syncthing: Emit new RemoteDownloadProgress event to track remote download progress 2016-05-22 07:52:08 +00:00
ignore vendor: Update github.com/gobwas/glob (fixes #3174) 2016-05-28 04:43:54 +00:00
logger cmd/syncthing: Extract interfaces for things the API depends on 2016-03-21 19:36:08 +00:00
model lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
nat lib/nat, lib/connections: Fix a few issues with NAT traversal 2016-05-27 06:28:46 +00:00
osutil gui: /rest/system/browse with no arguments returns drives on Windows (ref #3201) 2016-05-31 19:27:07 +00:00
pmp vendor: Revert to github.com/jackpal/gateway instead of fork 2016-06-02 20:40:30 +00:00
protocol lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
rand lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
rc cmd/stbench: Add utility to run benchmark tests 2016-03-25 20:52:20 +00:00
relay lib/relay: Correctly get IP from remote addr via proxy (fixes #3223) 2016-05-31 14:42:10 +00:00
scanner lib/scanner: Refactor scanner.Walk API 2016-05-09 18:25:39 +00:00
signature The PublicKey() method is an addition in Go 1.4 2015-10-27 16:03:14 +01:00
stats lib/model, lib/stats: Keep track of folder's last scan time (ref #3143) 2016-06-02 19:26:52 +00:00
symlinks Fix import paths 2015-09-22 19:38:46 +02:00
sync lib/sync: Skip the timing tests if the host timer is flaky 2016-03-27 10:41:38 +00:00
tlsutil lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
upgrade lib/upgrade: Prefer a minor upgrade over a major (fixes #3163) 2016-05-25 14:01:52 +00:00
upnp lib: simplify code 2016-05-18 22:47:11 +00:00
util lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
versioner lib/versioner: Refactor for testing, speed up test 2016-04-15 14:26:39 +00:00