syncthing/lib/connections
André Colomb ab0eb909a2
gui, lib/connections: Let the backend decide whether connection is local (fixes #8686) (#8694)
* lib/connections: Cache isLAN decision for later external access.

The check whether a remote device's address is on a local network
currently happens when handling the Hello message, to configure the
limiters.  Save the result to the ConnectionInfo and pass it out as
part of the model's ConnectionInfo struct in ConnectionStats().

* gui: Use provided connection attribute to distinguish LAN / WAN.

Replace the dumb IP address check which didn't catch common cases and
actually could contradict what the backend decided.  That could have
been confusing if the GUI says WAN, but the limiter is not actually
applied because the backend thinks it's a LAN.

Add strings for QUIC and relay connections to also differentiate
between LAN and WAN.

* gui: Redefine reception level icons for all connection types.

Move the mapping to the JS code, as it is much easier to handle
multiple switch cases by fall-through there.

QUIC is regarded no less than TCP anymore.  LAN and WAN make the
difference between levels 4 / 3 and 2 / 1:

{TCP,QUIC} LAN --> {TCP,QUIC} WAN --> Relay LAN --> Relay WAN -->
Disconnected.
2022-11-28 09:28:33 +01:00
..
mocks lib: Use counterfeiter to mock interfaces in tests (#7375) 2021-03-03 08:53:50 +01:00
registry lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
connections_test.go lib/connections: Always run a simple connection test (#7866) 2022-04-10 20:54:42 +02:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
deprecated.go lib/connections: Handle QUIC not being available (#7186) 2020-12-09 19:23:50 +01:00
dialqueue_test.go all: Fix various user-facing and non-user-facing typos (#8509) 2022-08-23 15:44:11 +02:00
dialqueue.go lib/config, lib/connections: Add optional connection limits (fixes #7176) (#7223) 2021-01-11 15:14:44 +01:00
lan_test.go all: Refactor preparing configuration (#7127) 2020-11-20 14:21:54 +01:00
limiter_test.go lib/connections: Use adaptive write size for rate limited connections (fixes #8630) (#8631) 2022-11-03 15:44:46 +01:00
limiter.go lib/connections: Use adaptive write size for rate limited connections (fixes #8630) (#8631) 2022-11-03 15:44:46 +01:00
quic_dial.go all: Modernize error wrapping (#8491) 2022-08-16 10:01:49 +02:00
quic_listen.go all: Fix unused method receiver (further) (#8466) 2022-07-28 17:55:29 +02:00
quic_misc.go lib: Factor out getting IP address from net.Addr (#8538) 2022-09-14 08:44:46 +02:00
quic_unsupported.go all: Unused errors 2022-07-28 19:08:51 +02:00
relay_dial.go lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
relay_listen.go all: Modernize error wrapping (#8491) 2022-08-16 10:01:49 +02:00
service.go gui, lib/connections: Let the backend decide whether connection is local (fixes #8686) (#8694) 2022-11-28 09:28:33 +01:00
structs.go gui, lib/connections: Let the backend decide whether connection is local (fixes #8686) (#8694) 2022-11-28 09:28:33 +01:00
tcp_dial.go lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
tcp_listen.go lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
util.go lib/connections: Add connection benchmarks, allow binding to port zero addresses (#7648) 2021-05-10 15:44:47 +01:00