chore(config): use openvpn protocol string field instead of TCP bool
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/constants/vpn"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
@@ -147,7 +148,7 @@ func filterByProtocol(selection settings.ServerSelection,
|
||||
case vpn.Wireguard:
|
||||
return !serverUDP
|
||||
default: // OpenVPN
|
||||
wantTCP := *selection.OpenVPN.TCP
|
||||
wantTCP := selection.OpenVPN.Protocol == constants.TCP
|
||||
wantUDP := !wantTCP
|
||||
return (wantTCP && !serverTCP) || (wantUDP && !serverUDP)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func noServerFoundError(selection settings.ServerSelection) (err error) {
|
||||
messageParts = append(messageParts, "VPN "+selection.VPN)
|
||||
|
||||
protocol := constants.UDP
|
||||
if *selection.OpenVPN.TCP {
|
||||
if selection.OpenVPN.Protocol == constants.TCP {
|
||||
protocol = constants.TCP
|
||||
}
|
||||
messageParts = append(messageParts, "protocol "+protocol)
|
||||
|
||||
Reference in New Issue
Block a user