TUN-7167: Respect protocol overrides with --token
Previously, if run with both `--protocol` and `--token` the protocol would be incorrectly overridden to QUIC.
This commit is contained in:
parent
079631ccea
commit
ea6fe121f8
connection
|
@ -218,11 +218,6 @@ func NewProtocolSelector(
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// When a --token is provided, we want to start with QUIC but have fallback to HTTP2
|
|
||||||
if tunnelTokenProvided {
|
|
||||||
return newDefaultProtocolSelector(QUIC), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
threshold := switchThreshold(accountTag)
|
threshold := switchThreshold(accountTag)
|
||||||
fetchedProtocol, err := getProtocol(ProtocolList, protocolFetcher, threshold)
|
fetchedProtocol, err := getProtocol(ProtocolList, protocolFetcher, threshold)
|
||||||
log.Debug().Msgf("Fetched protocol: %s", fetchedProtocol)
|
log.Debug().Msgf("Fetched protocol: %s", fetchedProtocol)
|
||||||
|
@ -244,6 +239,10 @@ func NewProtocolSelector(
|
||||||
case HTTP2.String():
|
case HTTP2.String():
|
||||||
return &staticProtocolSelector{current: HTTP2}, nil
|
return &staticProtocolSelector{current: HTTP2}, nil
|
||||||
case AutoSelectFlag:
|
case AutoSelectFlag:
|
||||||
|
// When a --token is provided, we want to start with QUIC but have fallback to HTTP2
|
||||||
|
if tunnelTokenProvided {
|
||||||
|
return newDefaultProtocolSelector(QUIC), nil
|
||||||
|
}
|
||||||
return newRemoteProtocolSelector(fetchedProtocol, ProtocolList, threshold, protocolFetcher, resolveTTL, log), nil
|
return newRemoteProtocolSelector(fetchedProtocol, ProtocolList, threshold, protocolFetcher, resolveTTL, log), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue