Skip to content
Snippets Groups Projects
Verified Commit 6591ea5d authored by Pea Nut's avatar Pea Nut
Browse files

Don't return gateway twice for manual location selection, fixes #823

This fixes a small logic error. Each gateway can be multiple times in
p.recommened (for each transport). If a location was selected manually,
each gateway was added twice to the returned list. The returned list is
the list of gateways we will connect to. For more information, please
check the merge request description.
parent a4374993
No related branches found
No related tags found
No related merge requests found
Pipeline #227684 passed
......@@ -173,10 +173,10 @@ func (p *gatewayPool) getGatewaysFromMenshenByLocation(location, transport strin
var gateways []Gateway
for _, gw := range p.recommended {
if !gw.gateway.isTransport(transport) {
continue
}
for _, locatedGw := range gws {
if !locatedGw.isTransport(transport) {
continue
}
if locatedGw.Host == gw.gateway.Host {
gateways = append(gateways, *locatedGw)
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment