Maintenance: deduplicate PIA servers by protocols

This commit is contained in:
Quentin McGaw
2021-02-16 13:06:58 +00:00
parent b9b2f691a5
commit c5af536299
6 changed files with 605 additions and 646 deletions

View File

@@ -341,8 +341,9 @@ func filterPIAServers(servers []models.PIAServer, regions []string, protocol str
filtered []models.PIAServer) {
for _, server := range servers {
switch {
case filterByPossibilities(server.Region, regions):
case server.Protocol != protocol:
case filterByPossibilities(server.Region, regions),
protocol == constants.TCP && !server.TCP,
protocol == constants.UDP && !server.UDP:
default:
filtered = append(filtered, server)
}