forked from Mxmilu666/frp
chore(ci): update Go version and golangci-lint version
feat(linter): add new linters G118 and G704 refactor(proxy): optimize proxy status slice initialization fix(api): clarify comment regarding URL construction fix(deps): upgrade github.com/hashicorp/yamux to v0.1.2 docs(flags): improve DNS server flag description refactor(controller): simplify port range return logic refactor(featuregate): optimize enabled features string conversion
This commit is contained in:
@@ -375,7 +375,6 @@ func getRangePorts(addrs []string, difference, maxNumber int) []msg.PortsRange {
|
||||
if !isLast {
|
||||
return nil
|
||||
}
|
||||
var ports []msg.PortsRange
|
||||
_, portStr, err := net.SplitHostPort(addr)
|
||||
if err != nil {
|
||||
return nil
|
||||
@@ -384,9 +383,8 @@ func getRangePorts(addrs []string, difference, maxNumber int) []msg.PortsRange {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
ports = append(ports, msg.PortsRange{
|
||||
return []msg.PortsRange{{
|
||||
From: max(port-difference-5, port-maxNumber, 1),
|
||||
To: min(port+difference+5, port+maxNumber, 65535),
|
||||
})
|
||||
return ports
|
||||
}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user