This makes the various protocol priorities configurable among the other options. With this, it's possible to prefer QUIC over TCP for WAN connections, for example. Both sides need to be similarly configured for this to work properly. The default priority order remains the same as previously (TCP, QUIC, Relay, with LAN better than WAN). To make this happen I made each dialer & listener more priority aware, and moved the check for whether a connection is LAN or not into the dialer / listener -- this is the new "lanChecker" type that's passed around.
This commit is contained in:
@@ -55,6 +55,15 @@ func (opts *OptionsConfiguration) prepare(guiPWIsSet bool) {
|
||||
if opts.ConnectionLimitMax < 0 {
|
||||
opts.ConnectionLimitMax = 0
|
||||
}
|
||||
|
||||
if opts.ConnectionPriorityQUICWAN <= opts.ConnectionPriorityQUICLAN {
|
||||
l.Warnln("Connection priority number for QUIC over WAN must be worse (higher) than QUIC over LAN. Correcting.")
|
||||
opts.ConnectionPriorityQUICWAN = opts.ConnectionPriorityQUICLAN + 1
|
||||
}
|
||||
if opts.ConnectionPriorityTCPWAN <= opts.ConnectionPriorityTCPLAN {
|
||||
l.Warnln("Connection priority number for TCP over WAN must be worse (higher) than TCP over LAN. Correcting.")
|
||||
opts.ConnectionPriorityTCPWAN = opts.ConnectionPriorityTCPLAN + 1
|
||||
}
|
||||
}
|
||||
|
||||
// RequiresRestartOnly returns a copy with only the attributes that require
|
||||
|
||||
Reference in New Issue
Block a user