syncthing/lib/connections
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
..
debug.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
limitedreader.go Decouple connections service from model 2015-09-25 12:19:30 -04:00
limitedwriter.go Decouple connections service from model 2015-09-25 12:19:30 -04:00
relay_dial.go lib/connections: Handle wrapped connection in SetTCPOptions (fixes #3223) 2016-05-31 08:11:57 +00:00
relay_listen.go lib/connections: Relay failures should be informative, not warning 2016-06-04 10:41:36 +00:00
service.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
structs.go lib/protocol: Understand older/newer Hello messages (fixes #3287) 2016-06-09 10:50:14 +00:00
tcp_dial.go lib/connections: Do not resolve addresses (fixes #3129) 2016-05-21 01:31:23 +00:00
tcp_listen.go lib/connections: Handle wrapped connection in SetTCPOptions (fixes #3223) 2016-05-31 08:11:57 +00:00